OpenCC: Difference between revisions
Jump to navigation
Jump to search
m
→Usage
m (→Usage) |
m (→Usage) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 17: | Line 17: | ||
# (optional) {{kbd | key=<nowiki>sudo ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2</nowiki>}} | # (optional) {{kbd | key=<nowiki>sudo ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2</nowiki>}} | ||
To check if | To check if the opencc was installed successfully, run this command in your terminal: | ||
<pre> | <pre> | ||
opencc --version | opencc --version | ||
</pre> | </pre> | ||
Expected result are as the following | Expected result are as the following. Notice the version number may not be the same with yours. | ||
<pre> | <pre> | ||
Open Chinese Convert (OpenCC) Command Line Tool | Open Chinese Convert (OpenCC) Command Line Tool | ||
| Line 48: | Line 48: | ||
# echo "项目管理" | opencc -c s2tw | # echo "项目管理" | opencc -c s2tw | ||
項目管理 | 項目管理 | ||
## Convert the Traditional Chinese if converted from Simplified Chinese words not correctly | |||
# echo "項目管理" | opencc -c tw2s | opencc -c s2twp | |||
專案管理 | |||
</pre> | </pre> | ||
Input/Output: file | Input/Output: file | ||
<pre> | <pre> | ||
## Simplified Chinese to Traditional Chinese (Taiwan Standard) | ## Convert the text file encoding with Simplified Chinese to Traditional Chinese (Taiwan Standard) | ||
# opencc -i input.txt -o output.txt -c s2tw | # opencc -i input.txt -o output.txt -c s2tw | ||
</pre> | </pre> | ||
== Troubleshootings == | == Troubleshootings == | ||
=== cmake: command not found === | === cmake: command not found on CentOS === | ||
Error message: | Error message: | ||
<pre> | <pre> | ||
| Line 72: | Line 76: | ||
</pre> | </pre> | ||
Solution: | Solution<ref>How to run make from Cygwin environment? - Stack Overflow https://stackoverflow.com/questions/17710209/how-to-run-make-from-cygwin-environment</ref>: | ||
# Install GCC from repository {{kbd | key=<nowiki>sudo yum -y install gcc</nowiki>}} | # Install GCC from repository {{kbd | key=<nowiki>sudo yum -y install gcc</nowiki>}} | ||
#* Verify the version of gcc because gcc 4.6 is required. {{kbd | key=<nowiki>gcc --version</nowiki>}} | #* Verify the version of gcc because gcc 4.6 is required. {{kbd | key=<nowiki>gcc --version</nowiki>}} | ||
| Line 120: | Line 124: | ||
Solution: | Solution: | ||
# Keyin: {{kbd | key=<nowiki>sudo ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2</nowiki>}}<ref>[https://github.com/BYVoid/OpenCC/issues/259 opencc: error while loading shared libraries: libopencc.so.2: cannot open shared object file: No such file or directory · Issue #259 · BYVoid/OpenCC · GitHub]</ref> | # Keyin: {{kbd | key=<nowiki>sudo ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2</nowiki>}}<ref>[https://github.com/BYVoid/OpenCC/issues/259 opencc: error while loading shared libraries: libopencc.so.2: cannot open shared object file: No such file or directory · Issue #259 · BYVoid/OpenCC · GitHub]</ref> | ||
== References == | == References == | ||