Let Linux speak English-general Linux technology-Linux technology and application information. The following is a detailed description. The computer's input and output interfaces not only include the keyboard, mouse, handwriting recognition, and display in the traditional sense, but also should be able to understand the "language", that is, speech recognition, and then "sound ", that is, speech synthesis. I like to use Linux and use IBM's voice solutions to create a solution that allows Linux to speak English. Kang Yi 16:59:37 from chinacache
The computer's input and output interfaces not only include the keyboard, mouse, handwriting recognition, and display in the traditional sense, but also should be able to understand the "language", that is, speech recognition, and then "sound ", that is, speech synthesis. Research and Application in this area are rapidly underway. Many companies in the world are engaged in speech recognition and synthesis research, such as IBM, Microsoft, AT & T, L & H, Lucent, and Lesstif. Today, these research results have come out of the lab and launched products in all aspects of social production services, such as voice e-mails, voice input methods, telephone banking, customer service centers, and intelligent robots. I like to use Linux and use IBM's voice solutions to create a solution that allows Linux to speak English.
Because I use RedHat Linux6.0 and often use the English-Chinese dictionary tool Xdict, the first thing to do is to improve it. First, obtain the Xdict source program file, which can be downloaded from the source program CD or network of other Linux systems (such as Turbo Linux 4.0. The version I get is xdict-0.1-3.src.rpm. Open the source package above in File Manager or gmc to decompress the xdict-0.1.tgz.
(1) copy to the root directory for decompression:
# Tar-xzvf xdict-0.1.tgz
(2) enter the xdict-0.1 directory:
# Cd xdict-0.1
(3) Open the Makefile file in the xdict-0.1 directory with gEdit and change INCPATH =-I $ (QTDIR)/include/qt to INCPATH =-I $ (QTDIR) /usr/include/qt (or modify it based on the directory where the actual QT is located ).
(4) Compile and join:
# Make
In this way, the executable file Xdict is generated. However, to execute this file, copy the library file xdict. lib and the index file xdicten. idx to the directory/usr/lib/xdict:
# Mkdir-p/usr/lib/xdict
Find the copy directory of xdict. lib and xdicten. idx/usr/lib/xdict:
# Cp xdict. lib xdicten. idx/usr/lib/xdict
(5) Start X-Window and run xdict:
# Startx
#./Xdict
Here is a brief introduction to QT. QT is a popular object-oriented programming C ++ software development kit in Linux. It also supports Windows and Unix. You can download QT Free Edition at www. troll. no/dl/qtfree_dl.html. In RedHat Linux 6.0 is the version of the Qt devel-1.44-6. Install the include file in/usr/include/qt. Examples, documents, and a series of tutorials are installed in different directories under/usr/lib/qt. We can access the local file:/usr/lib/qt/html/index.html, these include graphical GUI controls, OpenGL 3D graphics support, object-oriented programming class layers, Qt-based plug-ins for IE and Netscape, and 14 tutorials for familiarity with programming languages.
Next, let's analyze the Xdict source code. The Xdict class is derived from the QDialog subclass of QT. The details of the QDialog class of the dialog box can be found in file:/usr/lib/qt/html/qdialog.html. Its inheritance relationship is 1.
[Click an image to open it in a new window]
Inheritance relationship of QDialog
The main interface of Xdict is dialog box type, which contains a Word input Edit box input, derived from the QLineEdit class. For details, see file:/usr/lib/qt/html/qlineedit.html. The four buttons reloadBtn, prevBtn, nextBtn, and aboutBtn are derived from QAutoButton. For details, see autobt. h and autobt. cpp. The Wordlist and Showlist lists are used to display English words and their Chinese interpretations. They are derived from the QListBox class. For details, see file:/usr/lib/qt/html/qlistbox.html.
In xdict. h The source file defines the main function functions: Initialize the function xdict (), press any key to process the function keyPressEvent (), display the word list to process inputWord (), and "about" button to process aboutBtnclick () reloadBtnclick (), forward button processing prevBtnclick (), backward button processing nextBtnclick (), and worddhighlight () in wordlist () in wordlist, double-click a word processing function wordSelected (), and inputReturn ().
The detailed structure of these functions is available in xdict. cpp. The following briefly analyzes the initialization function xdict (), as shown in figure 2. Other functions can follow this type.
To pronounce a dictionary, you only need to call the pronunciation function when you enter a word and press enter to display the Chinese character translation, that is, add the eciSpeakText function in the xdict. cpp.
[Click an image to open it in a new window]
Brief Analysis initialization function Xdict ()
Void xdict: inputReturn ()
{EcispeakText (input-> text (), false );
......
}
Note that you need to re-compile and add the ibmeci50 library LIBS =-L $(QTDIR)/lib-lqt-libmeci50 to the Makefile file before joining ...... (-l is a command line parameter)
Then run make. To enjoy the standard word speech!
In addition, I want to know how to package files in Linux, that is, how to make. rpm files? Please kindly advise, my email address: kangqian@21cn.com.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service