https://wiki.archlinux.org/api.php?action=feedcontributions&user=Yibe&feedformat=atomArchWiki - User contributions [en]2024-03-29T10:59:39ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Mozc&diff=601167Mozc2020-03-12T13:48:48Z<p>Yibe: /* Installation */ fix dead links</p>
<hr />
<div>[[Category:Input methods]]<br />
[[ja:Mozc]]<br />
From the project [https://github.com/google/mozc home page]:<br />
:'''Mozc''' is a Japanese [[input method]] editor (IME) designed for multi-platform such as Android OS, Apple OS X, Chromium OS, GNU/Linux and Microsoft Windows. This OpenSource project originates from [http://www.google.com/intl/ja/ime/ Google Japanese Input]. […] Detailed differences between Google Japanese Input and Mozc are described in [https://github.com/google/mozc/blob/master/docs/about_branding.md About Branding].<br />
(In short, Mozc does not have equivalent conversion quality to Google Japanese Input).<br />
<br />
== Installation ==<br />
<br />
Depending on your target setup, there are several available Mozc packages to choose from. Firstly, you will likely need to install both the Mozc core package and an integration for the Input Method Framework of your choice (such as [[Fcitx]], [[IBus]], or [[Uim]]), though some Fcitx packages come bundled with the core. Secondly, there exist some unofficial dictionaries: The '''UT''' (discontinued) and '''UT2''' dictionaries, which are combined from several sources with hit numbers coming from Google/Yahoo and Wikipedia, respectively, and the '''NEologd UT''' dictionary based on the mecab-ipadic-NEologd Neologism dictionary.<br />
<br />
The following table shows the packages corresponding to certain combinations of the components and dictionaries; colored cells indicate split packages. Some of the packages are also available from the [[Unofficial user repository#pnsft-pur|pnsft-pur]] repository.<br />
<br />
{| class="wikitable"<br />
|+IMF integration packages<br />
! Dictionary !! [[Fcitx]] !! [[IBus]] !! [[Emacs]] !! [[Uim]]<br />
|-<br />
! Official<br />
| {{Pkg|fcitx-mozc}}<br />
| style="background:#d7d7ff" | {{AUR|ibus-mozc}}<br />
| style="background:#d7d7ff" | {{AUR|emacs-mozc}}<br />
| {{AUR|uim-mozc}}<br />
|-<br />
! [http://linuxplayers.g1.xrea.com/mozc-ut.html UT]<br />
| {{AUR|fcitx-mozc-ut}}<br />
|-<br />
! [http://linuxplayers.g1.xrea.com/mozc-ut2.html UT2]<br />
| style="background:#d7d7ff" | {{AUR|fcitx-mozc-ut2}}<br />
| style="background:#d7d7ff" | {{AUR|ibus-mozc-ut2}}<br />
| style="background:#d7d7ff" | {{AUR|emacs-mozc-ut2}}<br />
| style="background:#d7d7ff" | {{AUR|uim-mozc-ut2}}<br />
|-<br />
! [http://linuxplayers.g1.xrea.com/mozc-neologd-ut.html NEologd UT]<br />
| {{AUR|fcitx-mozc-neologd-ut}}<br />
|}<br />
<br />
Some of the above packages also contain definitions at the top of their respective [[PKGBUILD]]s that can be altered to (de)activate certain features. Most notably, to build the Emacs packages you need to uncomment the {{ic|_emacs_mozc}} line:<br />
## If you will be using mozc.el on Emacs, uncomment below.<br />
_emacs_mozc="yes"<br />
Likewise, you must also enable uim-mozc-ut2 manually to build it.<br />
<br />
Once Mozc is installed, you might need to restart X or your Input Method Framework before you can use it.<br />
<br />
== Configuration ==<br />
<br />
=== IBus ===<br />
''See also [[IBus]] for IBus configuration.''<br />
<br />
If you use Mozc by default, set it via ''ibus-setup'':<br />
$ ibus-setup<br />
Choose ''Input Method'' tab and move ''Mozc'' to top of the list.<br />
<br />
You can switch input method by {{ic|Alt+Shift_L}} (by IBus default).<br />
<br />
=== uim ===<br />
''See also [[Uim]] for uim configuration.''<br />
<br />
Configure uim preferences by running:<br />
$ uim-pref-gtk (Or, uim-pref-gtk3/uim-pref-qt4)<br />
which brings forth a GUI.<br />
<br />
Choose your preferring input method as ''Default input method''.<br />
{{Note|Mozc will be not listed in ''Default input method'' at first time so you will need to add it into ''Enabled input methods'' to use.}}<br />
<br />
{{Warning|You '''must''' run the following command whenever you upgrade or (re-)install '''uim'''.<br/><br />
# uim-module-manager --register mozc}}<br />
<br />
=== Fcitx ===<br />
''See also [[Fcitx]] for Fcitx configuration.''<br />
<br />
Open the configuration dialog of Fcitx by running:<br />
$ fcitx-configtool<br />
In the ''Input Method'' tab, click on the plus sign and choose Mozc from the list in the dialog. Depending on your configuration, you might need to disable the ''Only Show Current Language'' option for Mozc to be available. After confirming the dialog, you can activate Mozc as input method using the usual keyboard shortcuts.<br />
<br />
=== Mozc for Emacs ===<br />
<br />
You can use mozc.el (mozc-mode) to input Japanese via LEIM (Library of Emacs Input Method). To use mozc-mode, write the following into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing:<br />
(require 'mozc) ; or (load-file "/path/to/mozc.el")<br />
(setq default-input-method "japanese-mozc")<br />
mozc.el provides "overlay" mode in the styles of showing candidates (from mozc r77) which shows a candidate window in box style close to the point. If you want to use it by default, add the following:<br />
(setq mozc-candidate-style 'overlay)<br />
<br />
{{ic|C-\}} (''toggle-input-method'') enables and disables use of mozc-mode.<br />
<br />
==== Disabling XIM on Emacs ====<br />
<br />
When you are using input method on your desktop and assigning activation/deactivation of input method to C-SPC, you will be not able to use C-SPC/C-@ as set-mark-command on Emacs. To avoid this problem, add the following into your {{Ic|~/.Xresources}} or {{Ic|~/.Xdefaults}}. xim will be disabled on Emacs.<br />
Emacs*UseXIM: false<br />
<br />
== Tips and tricks ==<br />
<br />
=== Confirming Mozc version which you are using now ===<br />
<br />
Type "ばーじょん" ("version") and convert it while activating Mozc. The version number of Mozc will be shown in the candidate list like follows:<br />
{{hc|<u>ばーじょん</u>|<br />
バージョン<br />
ヴァージョン<br />
ばーじょん<br />
Mozc-1.6.1187.102 ''⇐ Current version of Mozc''<br />
...}}<br />
<br />
=== Launching Mozc tools from command line ===<br />
<br />
The followings are commands to launch Mozc tools.<br />
* Mozc Settings: {{ic|1=$ /usr/lib/mozc/mozc_tool --mode=config_dialog}}<br />
* Mozc Dictionary Tool: {{ic|1=$ /usr/lib/mozc/mozc_tool --mode=dictionary_tool}}<br />
* Mozc Word Register: {{ic|1=$ /usr/lib/mozc/mozc_tool --mode=word_register_dialog}}<br />
* Mozc Hand Writing: {{ic|1=$ /usr/lib/mozc/mozc_tool --mode=hand_writing}}<br />
* Mozc Character Palette: {{ic|1=$ /usr/lib/mozc/mozc_tool --mode=character_palette}}<br />
<br />
{{Note|If the handwriting window displays an error when attempting to input handwriting, mozc may not have a handwriting module. One possible solution is to install {{AUR|tegaki-models-zinnia-japanese}} and re-open the window.}}<br />
<br />
=== Use CapsLock as Eisu_toggle key on ASCII layout keyboard ===<br />
<br />
In all of the preset keymap styles of Mozc, the command ''Toggle alphanumeric mode'' on ''Composition'' mode is assigned to the {{ic|Eisu}} (Eisu_toggle), {{ic|Hiragana/Katakana}} or {{ic|Muhenkan}} key, but the ASCII keyboard has none of them.<br />
<br />
One solution for it is to use Caps Lock key as Eisu_toggle (Mozc does not recognize the Caps Lock key as of r124). The following is a way to assign Eisu_toggle to {{ic|Caps Lock}} (without any modifier keys) and Caps_Lock to {{ic|Shift+CapsLock}}, as on the OADG keyboard layout.<br />
{{Warning|This will affect all applications.}}<br />
<br />
Edit {{ic|~/.Xmodmap}} as follows:<br />
keycode 66 = Eisu_toggle Caps_Lock<br />
clear Lock<br />
<br />
Then, restart X or run ''xmodmap'' to apply the changes immediately:<br />
$ xmodmap ~/.Xmodmap<br />
<br />
== Troubleshooting ==<br />
<br />
=== Building Mozc fails (process is killed) ===<br />
<br />
If the build process fails with an error message like the following:<br />
...<br />
/bin/sh: line 1: xxxx killed<br />
...<br />
make: *** [xxx/xxx...] error 137<br />
...<br />
Make sure you have not run out of memory.<br />
<br />
=== New version of Mozc does not appear though I upgraded Mozc and restarted X or Input Method Framework (not rebooted) ===<br />
<br />
The old version of Mozc may be still on your memory. Try to kill the existing ''mozc_server'' process:<br />
$ killall mozc_server<br />
<br />
=== mozc_server becomes defunct ===<br />
<br />
Mozc cannot run in root. Start X in normal user.<br />
<br />
=== mozc_emacs_helper not found in emacs ===<br />
<br />
When installing mozc.el you need to install a helper program called {{ic|mozc_emacs_helper}}.<br />
<br />
You need to install {{AUR|emacs-mozc}} or {{AUR|emacs-mozc-ut2}} for this helper program.</div>Yibehttps://wiki.archlinux.org/index.php?title=Rip_Audio_CDs&diff=243991Rip Audio CDs2013-01-15T21:30:59Z<p>Yibe: Changed the shebang line in the script so it works on systems where /bin/sh is not a symlink to bash</p>
<hr />
<div>[[Category:Optical]]<br />
CD rippers are designed to extract ("rip") the raw digital audio (in a format commonly called CDDA) from a compact disc to a file or other output. Most CD rippers also support burning audio to a CD and transcoding it on-the-fly.<br />
<br />
== Introduction ==<br />
Music is usually stored on audio CDs in an uncompressed format (requires a lot of space, e.g. 700MB for only 80 minutes of audio). Extracting the audio from the CD usually involves compressing it so that it requires less space using:<br />
; Lossless compression: same quality, less space.<br />
; Lossy compression: lower quality, much less space.<br />
<br />
Most common formats to convert to are: APE and FLAC for lossless and MP3 and OGG for lossy.<br />
<br />
== Ripping ==<br />
=== Using a CD ripper ===<br />
{{Box||For some examples of CD rippers see: [[Common Applications#CD Ripping]].|#E5E5FF|#FCFCFC}}<br />
<br />
=== Using a simple shell script ===<br />
If you want to rip an audio CD gapless and using CD-Text you can use the following shell script. You need to [[Pacman|install]] the {{Pkg|mp3splt}}, {{Pkg|cdrtools}} and {{Pkg|vorbis-tools}} packages, all available in the [[official repositories]].<br />
<br />
{{hc|rip_gapless.sh|<nowiki><br />
#!/bin/bash<br />
# This script needs mp3splt, cdrtools, vorbis-tools<br />
<br />
CREATE_OGG="true";<br />
CREATE_FLAC="false";<br />
CREATE_MKA="false";<br />
<br />
WORKING_DIRECTORY=`pwd`<br />
<br />
function usage() <br />
{ <br />
echo "Usage: $0 [OUTPUT_DIRECTORY] device";<br />
echo "eg.: $0 my_audio_cd /dev/sr0";<br />
exit;<br />
}<br />
<br />
function no_cdtext()<br />
{<br />
echo "CD doesn't contain cd-text information";<br />
echo "Please specify output directory";<br />
echo "$0 OUTPUT_DIRECTORY device";<br />
exit;<br />
}<br />
<br />
function remove_quotes() {<br />
local OUTPUT_STRING<br />
# remove quotes<br />
OUTPUT_STRING=$(echo "$1" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")<br />
# remove selected special characters<br />
echo "$OUTPUT_STRING" | sed "s/\(.*\)[\\]\(.*\)/\1\2/g"<br />
}<br />
<br />
<br />
# store command line parameters<br />
if [[ "$#" = "2" ]] ; then<br />
CDROM=$2;<br />
OUTPUT_DIRECTORY=$1;<br />
elif [[ "$#" = "1" ]] ; then<br />
CDROM=$1;<br />
else <br />
usage;<br />
fi<br />
<br />
# retrieve CD information<br />
echo "Retrieve CD information"<br />
CD_INFO=$(cdda2wav -J -g /dev/sr0 2>&1)<br />
<br />
# test if CD-Text is available<br />
if [[ "detected" == $(echo "${CD_INFO}" | awk '/^CD-Text.*/ {print $2}') ]]; then<br />
echo "CD-Text detected"<br />
CD_TEXT_DETECTED=true<br />
ALBUM_INFORMATION=$(echo "${CD_INFO}" | grep ^"Album title")<br />
# remove characters from beginning of string<br />
ALBUM_INFORMATION=$(echo "${ALBUM_INFORMATION#*Album title: }")<br />
ALBUM_TITLE=$(echo "${ALBUM_INFORMATION% from *}")<br />
ALBUM_TITLE=$(remove_quotes "${ALBUM_TITLE}")<br />
ALBUM_ARTIST=$(echo "${ALBUM_INFORMATION#* from }")<br />
ALBUM_ARTIST=$(remove_quotes "${ALBUM_ARTIST}")<br />
fi<br />
<br />
# check if cd has cdtext<br />
if [[ true == ${CD_TEXT_DETECTED} ]]; then<br />
if [[ "2" = "$#" ]]; then<br />
echo "CD-text found"<br />
echo "Overriding given output directory name"<br />
fi<br />
mkdir -p "./${ALBUM_ARTIST}/${ALBUM_TITLE}"<br />
cd "./${ALBUM_ARTIST}/${ALBUM_TITLE}"<br />
OUTPUT_DIRECTORY="${ALBUM_ARTIST}/${ALBUM_TITLE}"<br />
OUTPUT_FILENAME="${ALBUM_TITLE}"<br />
else<br />
if [[ "$#" != "2" ]]; then<br />
no_cdtext<br />
else<br />
mkdir "${OUTPUT_DIRECTORY}"<br />
cd "${OUTPUT_DIRECTORY}"<br />
OUTPUT_FILENAME="${OUTPUT_DIRECTORY}"<br />
fi<br />
fi<br />
<br />
cdda2wav -cuefile -paranoia -t all dev=${CDROM} "${OUTPUT_FILENAME}.wav" &> "${OUTPUT_FILENAME}.log"<br />
<br />
if [[ "true" = ${CREATE_OGG} ]]; then<br />
mkdir ogg<br />
pushd ogg<br />
oggenc -o "${OUTPUT_FILENAME}.ogg" -q 6 "../${OUTPUT_FILENAME}.wav"<br />
oggsplt -c "../${OUTPUT_FILENAME}.cue" -o "@N - @t" "${OUTPUT_FILENAME}.ogg"<br />
popd<br />
fi<br />
<br />
if [[ "true" = ${CREATE_FLAC} ]]; then<br />
mkdir flac<br />
pushd flac<br />
cd flac # -5 -V -T "ARTIST=%a" -T "ALBUM=%g" -T "DATE=%y" -T "GENRE=%m" --tag-from-file=CUESHEET="%a - %g.cue" --cuesheet="%a - %g.cue" %s<br />
flac --cuesheet="../${OUTPUT_FILENAME}.cue" --tag-from-file=CUESHEET="../${OUTPUT_FILENAME}.cue" --output-name="./${OUTPUT_FILENAME}.flac" --best "../${OUTPUT_FILENAME}.wav"<br />
popd<br />
fi<br />
<br />
if [[ "true" = ${CREATE_MKA} ]]; then<br />
mkdir mka<br />
pushd mka<br />
# -5 -V -T "ARTIST=%a" -T "ALBUM=%g" -T "DATE=%y" -T "GENRE=%m" --tag-from-file=CUESHEET="%a - %g.cue" --cuesheet="%a - %g.cue" %s<br />
flac --output-name="./${OUTPUT_FILENAME}.flac" --best "../${OUTPUT_FILENAME}.wav"<br />
mkvmerge -q -o "${OUTPUT_FILENAME}.flac.mka" "${OUTPUT_FILENAME}.flac" --attachment-mime-type text/plain --attachment-description "cdda2wav Log" --attach-file "../${OUTPUT_FILENAME}.log" --attachment-mime-type text/plain --attachment-description "Original CUE Sheet" --attach-file "../${OUTPUT_FILENAME}.cue" --title "${ALBUM_TITLE}" --chapters "../${OUTPUT_FILENAME}.cue"<br />
rm "./${OUTPUT_FILENAME}.flac"<br />
popd<br />
fi<br />
<br />
# rm "${WORKING_DIRECTORY}/${OUTPUT_DIRECTORY}/${OUTPUT_FILENAME}.{cddb,cdindex,cdtext,wav}"<br />
</nowiki>}}<br />
<br />
== Post-processing ==<br />
=== Tag Editors ===<br />
{{Box||For some examples of audio tag editors see: [[Common Applications#Audio tag editors]].|#E5E5FF|#FCFCFC}}<br />
=== Converting to other formats ===<br />
If the CD ripper you used does not support the format you wanted to convert to you can use other encoders/decoders such as [[FFmpeg]] or [[MEncoder]]. Some simple scripts to convert from [[Convert Flac to Mp3|flac]] or [[Convert Any To Mp3|other formats]] to mp3 can also be found on the wiki.</div>Yibe