OpenCC: Difference between revisions

Jump to navigation Jump to search
1,945 bytes added ,  10 March 2023
m
(Created page with "Install [https://github.com/BYVoid/OpenCC OpenCC] on Centos7. OpenCC is the project for "conversion between Traditional and Simplified Chinese". == Installation == Install [h...")
 
 
(12 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 7: Line 7:
#* 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>}}
# Install [https://cmake.org/ CMake] from repository {{kbd | key=<nowiki>sudo yum -y install cmake</nowiki>}}
# Install [https://cmake.org/ CMake] from repository {{kbd | key=<nowiki>sudo yum -y install cmake</nowiki>}}
#* Verify the installation of CMake: Input {{kbd | key=<nowiki>cmake--version</nowiki>}} Expected result are as the following:<pre>cmake version 2.8.12.2</pre>
# Install [https://www.gnu.org/software/make/ Make] from repository {{kbd | key=<nowiki>sudo yum -y install make</nowiki>}}
# Install [https://www.gnu.org/software/make/ Make] from repository {{kbd | key=<nowiki>sudo yum -y install make</nowiki>}}
#* Verify the installation of Make: Input {{kbd | key=<nowiki>make--version</nowiki>}} Expected result are as the following:<pre>GNU Make 3.82 ... </pre>
# Install [http://www.doxygen.nl/ Doxygen] from repository {{kbd | key=<nowiki>sudo yum -y install doxygen</nowiki>}}
# Install [http://www.doxygen.nl/ Doxygen] from repository {{kbd | key=<nowiki>sudo yum -y install doxygen</nowiki>}}
#* Verify the installation of doxygen: Input {{kbd | key=<nowiki>doxygen--version</nowiki>}} Expected result are as the following:<pre>1.8.5</pre>
# {{kbd | key=<nowiki>cd OpenCC</nowiki>}}
# {{kbd | key=<nowiki>cd OpenCC</nowiki>}}
# {{kbd | key=<nowiki>make</nowiki>}}
# {{kbd | key=<nowiki>make</nowiki>}}
# {{kbd | key=<nowiki>sudo make install</nowiki>}}
# {{kbd | key=<nowiki>sudo make install</nowiki>}}
# (optional) {{kbd | key=<nowiki>sudo ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2</nowiki>}}


Verify the installation
To check if the opencc was installed successfully, run this command in your terminal:
# Input {{kbd | key=<nowiki>opencc --version</nowiki>}}. And the 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
Version: 1.0.5
Version: 1.0.5
</pre>
== 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>
##  Simplified Chinese to Traditional Chinese (Taiwan Standard) with Taiwanese idiom
# echo "项目管理" | opencc -c s2twp
專案管理
## Traditional Chinese (Taiwan Standard) to Simplified Chinese with Mainland Chinese idiom
# echo "專案管理" | opencc -c tw2sp
项目管理
## Traditional Chinese (Taiwan Standard) to Simplified Chinese
# echo "專案管理" | opencc -c tw2s
专案管理
## Simplified Chinese to Traditional Chinese (Taiwan Standard)
# 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 36: 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 84: 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 ==
Line 90: Line 129:


[[Category:Software]]
[[Category:Software]]
[[Category:Translation]]
Anonymous user

Navigation menu