OpenCC: Difference between revisions

Jump to navigation Jump to search
1,111 bytes added ,  10 March 2023
m
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
Install [https://github.com/BYVoid/OpenCC OpenCC] on Centos7. OpenCC is the project for "conversion between Traditional and Simplified Chinese".
Install [https://github.com/BYVoid/OpenCC OpenCC] on [https://www.centos.org/download/ Centos7] Linux. OpenCC is the project for "conversion between Traditional and Simplified Chinese".


== Installation ==
== Installation ==
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>}}


Verify the installation of opencc:  
To check if the opencc was installed successfully, run this command in your terminal:
* Input {{kbd | key=<nowiki>opencc --version</nowiki>}}. Expected result are as the following:
<pre>
opencc --version
</pre>
 
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 25: Line 29:


== Usage ==
== Usage ==
See the details on the page: [https://github.com/BYVoid/OpenCC GitHub - BYVoid/OpenCC: A project for conversion between Traditional and Simplified Chinese]
Input/Output: characters
<pre>
<pre>
##  Simplified Chinese to Traditional Chinese (Taiwan Standard) with Taiwanese idiom
# echo "项目管理" | opencc -c s2twp
# echo "项目管理" | opencc -c s2twp
專案管理
專案管理


## Traditional Chinese (Taiwan Standard) to Simplified Chinese with Mainland Chinese idiom
# echo "專案管理" | opencc -c tw2sp
# echo "專案管理" | opencc -c tw2sp
项目管理
项目管理


## Traditional Chinese (Taiwan Standard) to Simplified Chinese
# echo "專案管理" | opencc -c tw2s
# echo "專案管理" | opencc -c tw2s
专案管理
专案管理


## Simplified Chinese to Traditional Chinese (Taiwan Standard)
# 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>
Input/Output: file
<pre>
## Convert the text file encoding with Simplified Chinese to Traditional Chinese (Taiwan Standard)
#  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 55: 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 103: 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 ==
Anonymous user

Navigation menu