CN109933215B - Chinese character pinyin conversion method, device, terminal and computer readable storage medium - Google Patents

Chinese character pinyin conversion method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109933215B
CN109933215B CN201910103354.1A CN201910103354A CN109933215B CN 109933215 B CN109933215 B CN 109933215B CN 201910103354 A CN201910103354 A CN 201910103354A CN 109933215 B CN109933215 B CN 109933215B
Authority
CN
China
Prior art keywords
converted
vocabulary
pinyin
library
polyphone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910103354.1A
Other languages
Chinese (zh)
Other versions
CN109933215A (en
Inventor
王旭
黄国华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910103354.1A priority Critical patent/CN109933215B/en
Publication of CN109933215A publication Critical patent/CN109933215A/en
Application granted granted Critical
Publication of CN109933215B publication Critical patent/CN109933215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a Chinese character pinyin conversion method, a Chinese character pinyin conversion device, a terminal and a computer-readable storage medium. The Chinese character pinyin conversion method of the embodiment of the invention comprises the following steps: acquiring a vocabulary to be converted; comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result; if the vocabulary to be converted contains polyphone, acquiring the part-of-speech type of the vocabulary to be converted, and calling a special dictionary corresponding to the part-of-speech type; and converting the polyphones to be converted into pinyin according to the pinyin corresponding to the polyphones in the vocabulary to be converted in the special dictionary, and converting the non-polyphones in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library. Thus, the multi-tone words in the dictionary are converted into pinyin according to the pinyin corresponding to the multi-tone words in the vocabulary to be converted, so that the correct rate of converting the Chinese characters into pinyin can be ensured.

Description

Chinese character pinyin conversion method, device, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of information data processing technologies, and in particular, to a method, an apparatus, a terminal, and a computer readable storage medium for converting pinyin of chinese characters.
Background
In a financial system in the financial industry, after receiving input information of a user, chinese characters such as financial professional vocabulary, user names and the like contained in the input information are often required to be converted into pinyin and written into a program code, but in the prior art, the accuracy of converting the Chinese characters into pinyin is lower.
Disclosure of Invention
The invention mainly aims to provide a Chinese character pinyin conversion method, a Chinese character pinyin conversion device, a terminal, a computer readable storage medium and a computer readable storage medium, and aims to solve the technical problem that the correct rate of Chinese character pinyin conversion is low.
In order to achieve the above purpose, the present invention provides a method for converting pinyin for Chinese characters, comprising the steps of: acquiring a vocabulary to be converted;
comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result;
if the vocabulary to be converted contains polyphone, acquiring the part-of-speech type of the vocabulary to be converted, and calling a special dictionary corresponding to the part-of-speech type;
and converting the polyphone words to be converted into pinyin according to the pinyin corresponding to the polyphone words in the vocabulary to be converted in the special dictionary, and converting the non-polyphone words in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library.
Preferably, the step of comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result includes:
comparing each Chinese character in the vocabulary to be converted with a preset polyphone library respectively, and judging whether the Chinese characters in the vocabulary to be converted are the same as polyphones in the polyphone library;
if the Chinese characters in the vocabulary to be converted are judged to be the same as the polyphones in the polyphone library, the vocabulary to be converted is judged to contain the polyphones.
Preferably, the step of obtaining the part-of-speech category of the vocabulary to be converted and calling a special dictionary corresponding to the part-of-speech category includes:
determining an input information type corresponding to the vocabulary to be converted according to the information type of an input box where the vocabulary to be converted is located;
and determining the part-of-speech category of the vocabulary to be converted according to the input information type, and calling a special dictionary corresponding to the part-of-speech category.
Preferably, the special dictionary includes a surname dictionary corresponding to name nouns, and if the vocabulary to be converted includes polyphone, the part-of-speech class of the vocabulary to be converted is obtained, and before the special dictionary corresponding to the part-of-speech class is called, the Chinese pinyin conversion method further includes the steps of:
acquiring a Chinese surname library, wherein the Chinese surname library comprises a plurality of surnames and pinyin corresponding to each surname;
comparing surnames in the Chinese surname library with the polyphonic character library, extracting surnames containing polyphonic characters, and obtaining pinyin of the polyphonic characters in the surnames;
and storing the pinyin of the polyphone in the surname dictionary.
Preferably, the part of speech category of the vocabulary to be converted includes a name noun and a non-name noun, the step of converting the polyphone to be converted into pinyin according to pinyin corresponding to the polyphone in the vocabulary to be converted in the special dictionary, and converting the non-polyphone in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library includes:
judging whether the part of speech class of the vocabulary to be converted is a name noun;
if the part of speech class of the vocabulary to be converted is a name noun, comparing the polyphone in the vocabulary to be converted and the Chinese characters before the polyphone as a field to be determined with each surname in the surname dictionary, and judging whether the continuous field of surnames in the surname dictionary is the same as the field to be determined;
if the continuous fields of surnames in the surname dictionary are the same as the fields to be determined, multi-tone words in the vocabulary to be converted are converted into pinyin according to the pinyin of the surnames which are the same as the fields to be determined, and non-multi-tone words in the vocabulary to be converted are converted into pinyin according to a Chinese character pinyin library.
Preferably, the special dictionary further includes a user name library corresponding to name nouns, the step of converting the polyphone to be converted into pinyin according to pinyin corresponding to the polyphone in the vocabulary to be converted in the special dictionary, and converting the non-polyphone in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library further includes:
if no continuous field of surnames in the surname dictionary is the same as the field to be determined, comparing the vocabulary to be converted with all user names in a user name library, and judging whether the user names in the user name library are the same as the vocabulary to be converted;
and if the user names in the user name library are the same as the vocabulary to be converted, converting the vocabulary to be converted into pinyin according to the pinyin of the user names which are the same as the vocabulary to be converted.
Preferably, if the user name in the user name library is the same as the vocabulary to be converted, the converting the vocabulary to be converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted if the user name in the user name library is the same as the vocabulary to be converted includes:
the pinyin of the user name which is the same as the vocabulary to be converted is sent to be played through a voice playing unit so as to confirm whether the pinyin is correct or not to the user;
receiving a judging instruction fed back by a user, wherein the judging instruction is a correct instruction or an error;
when the judging instruction is correct, converting the vocabulary to be converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted;
when the judging instruction is wrong, correcting the polyphones in the user name which is the same as the vocabulary to be converted into another pinyin, and then playing the corrected pinyin through a voice playing unit to confirm whether the pinyin is correct or not to the user until the judging instruction is correct, and converting the vocabulary to be converted into the pinyin according to the pinyin played by the voice playing unit when the judging instruction is correct.
The invention also provides a Chinese character pinyin conversion device, which comprises:
the first acquisition module is used for acquiring the vocabulary to be converted;
the first comparison module is used for comparing the vocabulary to be converted with a preset polyphone library and judging whether the vocabulary to be converted contains polyphones according to the comparison result;
the second acquisition module is used for acquiring part-of-speech types of the vocabulary to be converted when the vocabulary to be converted contains polyphone, and calling a special dictionary corresponding to the part-of-speech types;
and the conversion module is used for converting the polyphone words to be converted into pinyin according to the pinyin corresponding to the polyphone words in the vocabulary to be converted in the special dictionary and converting the non-polyphone words in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library.
The invention also provides a terminal which comprises a processor, a memory and a Chinese character pinyin conversion program stored on the memory and executable by the processor, wherein the Chinese character pinyin conversion program realizes the steps of the Chinese character pinyin conversion method according to any one of the above steps when being executed by the processor.
The present invention also provides a computer readable storage medium having stored thereon a chinese pinyin conversion program, wherein the chinese pinyin conversion program, when executed by a processor, implements the steps of the chinese pinyin conversion method as defined in any one of the above.
In the technical scheme of the invention, the vocabulary to be converted is obtained; comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result; if the vocabulary to be converted contains polyphone, acquiring the part-of-speech type of the vocabulary to be converted, and calling a special dictionary corresponding to the part-of-speech type; and converting the polyphones to be converted into pinyin according to the pinyin corresponding to the polyphones in the vocabulary to be converted in the special dictionary, and converting the non-polyphones in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library. Thus, the multi-tone words in the dictionary are converted into pinyin according to the pinyin corresponding to the multi-tone words in the vocabulary to be converted, so that the correct rate of converting the Chinese characters into pinyin can be ensured.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a terminal according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of a method for converting pinyin for Chinese characters according to the present invention;
FIG. 3 is a flowchart of a second embodiment of the pinyin conversion method of the present invention;
FIG. 4 is a flowchart of a third embodiment of the pinyin conversion method for Chinese characters according to the present invention;
FIG. 5 is a flowchart of a fourth embodiment of the pinyin conversion method of the present invention;
fig. 6 is a flowchart of a fifth embodiment of the pinyin conversion method for chinese characters according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The Chinese character pinyin conversion method related to the embodiment of the invention is mainly applied to terminals, and the terminals can be PC, portable computers, mobile terminals and the like with display and processing functions.
Referring to fig. 1, fig. 1 is a schematic diagram of a terminal structure according to an embodiment of the present invention. In an embodiment of the present invention, the terminal may include a processor 1001 (e.g., a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communications between these components; the user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface); the memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may alternatively be a storage device independent of the processor 1001.
Those skilled in the art will appreciate that the hardware configuration shown in fig. 1 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
With continued reference to FIG. 1, the memory 1005 of FIG. 1, which is a computer readable storage medium, may include an operating system, a network communication module, and a Chinese character pinyin conversion program.
In fig. 1, the network communication module is mainly used for connecting with a server and performing data communication with the server; and the processor 1001 may call the pinyin conversion program for chinese characters stored in the memory 1005 and perform the operations of the following pinyin conversion method.
Based on the hardware structure of the terminal, various embodiments of the Chinese character pinyin conversion method are provided.
The invention provides a Chinese character pinyin conversion method.
Referring to fig. 2, in an embodiment of the invention, the method for converting pinyin for chinese characters includes the following steps:
s101: acquiring a vocabulary to be converted;
the Chinese character pinyin conversion method of the embodiment of the invention can be executed by the terminal of the embodiment of the invention. After the user inputs the vocabulary to be converted into pinyin through the corresponding input box, the terminal acquires the vocabulary to be converted which is input by the user.
S102: comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result;
the multi-tone word library can be pre-established according to the Chinese dictionary, and the multi-tone word library contains all multi-tone words and pronunciation in Chinese. Each Chinese character in the vocabulary to be converted can be respectively compared with a preset polyphone library, and whether the Chinese characters in the vocabulary to be converted are the same as polyphones in the polyphone library or not is judged; if the Chinese characters in the vocabulary to be converted are judged to be the same as the polyphones in the polyphone library, the vocabulary to be converted is judged to contain the polyphones. Thus, the multi-tone word of the vocabulary to be converted can be accurately identified.
S103: if the vocabulary to be converted contains polyphone, acquiring the part-of-speech type of the vocabulary to be converted, and calling a special dictionary corresponding to the part-of-speech type;
when a user inputs information through an input box, the information type of the input box is determined, and the corresponding part-of-speech type is also determined. For example, if the input information type of the input box is a name, the corresponding part of speech type is a name noun, and the input information type corresponding to the vocabulary to be converted can be determined according to the information type of the input box where the vocabulary to be converted is located; and then determining the part-of-speech category of the vocabulary to be converted according to the input information type, and retrieving a special dictionary corresponding to the part-of-speech category. For example, the type of information input by the name input box is a name, and the corresponding part of speech type is a name noun; the type of information input by the address input box is an address, and the corresponding part of speech type is a place noun; the type of information input by the input box of the work unit is the name of the work unit, and then the corresponding part of speech type is the noun of the organization. The private dictionary includes a surname dictionary corresponding to a name noun and a non-surname dictionary corresponding to a non-name noun. Each part-of-speech category other than a name noun belongs to a non-name noun, for example, a place noun belongs to a non-name noun, and the special dictionary includes a place dictionary corresponding to the place noun; the organization nouns also belong to non-name nouns, and the private dictionary includes an organization dictionary corresponding to the organization nouns. Of course, in other embodiments, the part-of-speech categories are not limited to the above, and other part-of-speech categories may be determined based on the type of information entered by the input box. One part-of-speech category may correspond to one specific dictionary or may correspond to a plurality of specific dictionaries.
S104: and converting the polyphones to be converted into pinyin according to the pinyin corresponding to the polyphones in the vocabulary to be converted in the special dictionary, and converting the non-polyphones in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library.
The special dictionary comprises a plurality of special nouns, the special nouns in the special dictionary are special nouns containing multi-tone words, and the special dictionary also comprises the pinyin of the multi-tone words in each special noun in the special noun. The Chinese character phonetic library contains all Chinese characters and their correspondent pronunciation. The vocabulary to be converted can be compared with the special dictionary, the special nouns in the special dictionary which are consistent with the vocabulary to be converted are found, then the polyphones in the vocabulary to be converted are converted into pinyin according to the pinyin of the polyphones in the special nouns, and the non-polyphones in the vocabulary to be converted are converted into pinyin according to the Chinese character pinyin library.
The Chinese character pinyin conversion method of the embodiment of the invention obtains the vocabulary to be converted; comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result; if the vocabulary to be converted contains polyphone, acquiring the part-of-speech type of the vocabulary to be converted, and calling a special dictionary corresponding to the part-of-speech type; and converting the polyphones to be converted into pinyin according to the pinyin corresponding to the polyphones in the vocabulary to be converted in the special dictionary, and converting the non-polyphones in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library. Thus, the multi-tone words in the dictionary are converted into pinyin according to the pinyin corresponding to the multi-tone words in the vocabulary to be converted, so that the correct rate of converting the Chinese characters into pinyin can be ensured.
Referring to fig. 3, based on the above embodiment, the special dictionary includes a surname dictionary corresponding to a name noun, and before step S103, the chinese pinyin conversion method further includes the steps of:
s105: acquiring a Chinese surname library, wherein the Chinese surname library comprises a plurality of surnames and pinyin corresponding to each surname;
all surnames of China are exhausted in the Chinese surname library, and the Chinese surname library comprises pinyin corresponding to each surname.
S106: comparing surnames in the Chinese surname library with the polyphone library, extracting surnames containing polyphone, and obtaining pinyin of polyphone in the surnames;
s107: the pinyin of the polyphone in the surname is stored in the surname dictionary.
When converting Chinese characters into pinyin, non-polyphones can be directly converted into pinyin according to a Chinese character pinyin library, so that when establishing a surname dictionary, only polyphones are needed to be considered, the surnames containing polyphones are extracted from the China surname library, the pinyin of polyphones in the surnames is obtained, and the pinyin of the surnames containing polyphones and the polyphones in the surnames is stored in the surname dictionary so as to be convenient for converting the surnames containing polyphones into pinyin.
Step S105 to step S107 may be performed between step S102 and step S103, may be performed between step S101 and step S102, or may be performed between step S101.
Referring to fig. 2-4, according to the above embodiment, the part-of-speech category of the vocabulary to be converted includes a name noun and a non-name noun, and step S104 includes:
s1041: judging whether the part of speech class of the vocabulary to be converted is a name noun;
the part of speech type of the vocabulary to be converted can be determined according to the information type of the input box, and whether the part of speech type is a name noun is judged.
S1042: if the part of speech class of the vocabulary to be converted is a name noun, comparing the polyphone and Chinese characters before the polyphone in the vocabulary to be converted as the fields to be determined with the surname of each surname in the surname dictionary, and judging whether the continuous fields of surnames in the surname dictionary are the same as the fields to be determined;
the surname comprises a single surname and multiple surnames, the surname is possibly one character or a plurality of characters, the Chinese first name is the first name, and the Chinese first name is the last name, then the multi-tone character can be firstly assumed to be part of the surname, the Chinese characters before the multi-tone character and the multi-tone character are used as fields to be determined and are compared with the surnames in the surname dictionary, and whether the fields to be determined are surnames or part of the surnames is determined by judging whether the continuous fields of the surnames in the surname dictionary are the same as the fields to be determined.
S1043: if the continuous fields of the surnames in the surname dictionary are the same as the fields to be determined, multi-tone words in the vocabulary to be converted are converted into pinyin according to the pinyin of the surnames which are the same as the fields to be determined, and non-multi-tone words in the vocabulary to be converted are converted into pinyin according to the Chinese character pinyin library.
The continuous field of surname in surname dictionary is identical to the field to be determined, so that the field to be determined is surname or part of surname, the polyphone in the vocabulary to be converted can be converted into pinyin according to the pinyin of the same surname as the field to be determined, and the non-polyphone in the vocabulary to be converted can be converted into pinyin according to Chinese character pinyin library.
Referring to fig. 5, based on the above embodiment, the private dictionary further includes a user name library corresponding to name nouns, and step S104 further includes:
s1044: if no continuous field of surnames in the surname dictionary is the same as the field to be determined, comparing the vocabulary to be converted with each user name in the user name library, and judging whether the user name in the user name library is the same as the vocabulary to be converted;
if no consecutive fields of the surname dictionary are identical to the field to be determined, the polyphone can be considered not as surname but as first name. Comparing the vocabulary to be converted with each user name in the user name library, and judging whether the vocabulary to be converted exists in the user name library by judging whether the user names in the user name library are the same as the vocabulary to be converted.
S1045: if the user name in the user name library is the same as the vocabulary to be converted, the vocabulary to be converted is converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted.
The user name library comprises names of a plurality of users and corresponding pinyin, if the user names are the same as the vocabulary to be converted in the user name library, the vocabulary to be converted is converted into the pinyin according to the pinyin of the user names which are the same as the vocabulary to be converted, and therefore the consistency of the results of the two times of conversion of the same user into the pinyin can be ensured.
If no user name in the user name library is the same as the vocabulary to be converted, selecting the pronunciation with the highest frequency from the pronunciation of the polyphone, converting the polyphone into pinyin, and converting the non-polyphone in the vocabulary to be converted into pinyin according to the Chinese character pinyin library.
Further, if the user name library has the same user name as the vocabulary to be converted, the pinyin of the user name which is the same as the vocabulary to be converted can be sent to be played through the voice playing unit so as to confirm whether the pinyin is correct or not to the user; then receiving a judging instruction fed back by a user, wherein the judging instruction is a correct instruction or an error; when the instruction is judged to be correct, converting the vocabulary to be converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted; when the judging instruction is wrong, correcting the polyphones in the user name which is the same as the vocabulary to be converted into another pinyin, and then playing the corrected pinyin through the voice playing unit to confirm whether the pinyin is correct or not to the user until the judging instruction is correct, and converting the vocabulary to be converted into the pinyin according to the pinyin played by the voice playing unit when the judging instruction is correct. Thus, when the polyphones are names in the name nouns, the user can confirm the pronunciation, and the accuracy of pinyin conversion is further ensured.
Referring to fig. 6, based on the above embodiment, the specific dictionary further includes a non-surname dictionary corresponding to non-name nouns, and before step S103, the chinese pinyin conversion method further includes the steps of:
s108: acquiring a special word stock corresponding to the non-name nouns from a big data platform, wherein the special word stock comprises a plurality of special nouns corresponding to part-of-speech categories of the non-name nouns;
each part-of-speech class, except for a name noun, belongs to a non-name noun, that is, the non-name noun includes a plurality of part-of-speech class vocabularies, each of which corresponds to at least one specialized thesaurus. The big data platform stores a special word stock corresponding to the noun with the non-name. Various common proper nouns can be collected and stored by using a big data platform, and a corresponding proper word stock is formed. For example, the big data platform may collect and store organization nouns for a plurality of organizations from a plurality of systems or network platforms, forming an organization dictionary.
S109: comparing the special word stock with the polyphone stock, extracting special nouns containing polyphones from the special word stock, and obtaining the pinyin of the polyphones in the special nouns;
s110: the phonetic alphabets of the polyphones in the proper nouns containing the polyphones are stored in a non-surname dictionary corresponding to the part of speech class of the proper nouns.
When converting Chinese characters into pinyin, non-polyphones can be directly converted into pinyin according to a Chinese character pinyin library, so that when a non-surname dictionary is built, only polyphones are needed to be considered, proper nouns containing polyphones are extracted from a special word library, the pinyin of polyphones in the proper nouns is obtained, and the proper nouns containing polyphones and the pinyin of polyphones in the proper nouns are stored in the non-surname dictionary so as to be convenient for converting the non-name nouns containing polyphones into pinyin.
In addition, the invention also provides a Chinese character pinyin conversion device. The above-mentioned method for converting pinyin for a chinese character in any one of the embodiments may be implemented by the device for converting pinyin for a chinese character in this embodiment, where the device for converting pinyin for a chinese character includes:
the first acquisition module is used for acquiring the vocabulary to be converted;
the first comparison module is used for comparing the vocabulary to be converted with a preset polyphone library and judging whether the vocabulary to be converted contains polyphones according to the comparison result;
the second acquisition module is used for acquiring the part-of-speech class of the vocabulary to be converted when the vocabulary to be converted contains polyphone, and calling a special dictionary corresponding to the part-of-speech class;
and the conversion module is used for converting the polyphone words to be converted into pinyin according to the pinyin corresponding to the polyphone words in the vocabulary to be converted in the special dictionary and converting the non-polyphone words in the vocabulary to be converted into pinyin according to the preset Chinese character pinyin library.
Further, the first comparison module includes:
the comparison unit is used for respectively comparing each Chinese character in the vocabulary to be converted with a preset polyphone library and judging whether the Chinese characters in the vocabulary to be converted are the same as the polyphone in the polyphone library;
and the judging unit is used for judging that the vocabulary to be converted contains polyphones when the Chinese characters in the vocabulary to be converted are the same as the polyphones in the polyphone library.
Further, the second acquisition module includes:
the acquisition unit is used for determining the input information type corresponding to the vocabulary to be converted according to the information type of the input box where the vocabulary to be converted is located;
and the calling unit is used for determining the part-of-speech category of the vocabulary to be converted according to the input information type and calling the special dictionary corresponding to the part-of-speech category.
Further, the special dictionary includes a surname dictionary corresponding to the name nouns, and the Chinese phonetic transcription device further includes:
the third acquisition module is used for acquiring a Chinese surname library, wherein the Chinese surname library comprises a plurality of surnames and pinyin corresponding to each surname;
the second comparison module is used for comparing surnames in the Chinese surname library with the polyphonic character library, extracting surnames containing polyphonic characters and obtaining pinyin of polyphonic characters in the surnames;
the first execution module is used for storing the family names containing the polyphones and the pinyin of the polyphones in the family names into the family name dictionary.
Further, the part of speech class of the vocabulary to be converted includes a name noun and a non-name noun, and the conversion module includes:
the first judging unit is used for judging whether the part of speech class of the vocabulary to be converted is a name noun;
the first comparison unit is used for comparing the polyphone in the vocabulary to be converted and the Chinese characters before the polyphone as the fields to be determined with the surnames in the surname dictionary when the part of speech class of the vocabulary to be converted is a name noun, and judging whether the continuous fields of the surnames in the surname dictionary are the same as the fields to be determined;
the first conversion unit is used for converting the polyphone in the vocabulary to be converted into pinyin according to the pinyin of the surname identical to the field to be determined when the continuous field of the surname in the surname dictionary is identical to the field to be determined, and converting the non polyphone in the vocabulary to be converted into pinyin according to the Chinese character pinyin library.
Further, the private dictionary further includes a user name library corresponding to the name nouns, and the conversion module includes:
the second comparison unit is used for comparing the vocabulary to be converted with each user name in the user name library when the continuous fields without surnames in the surname dictionary are the same as the fields to be determined, and judging whether the user names in the user name library are the same as the vocabulary to be converted;
and the second conversion unit is used for converting the vocabulary to be converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted when the user name is the same as the vocabulary to be converted in the user name library.
Further, the second conversion unit includes:
the voice control subunit is used for sending the pinyin of the user name which is the same as the vocabulary to be converted to be played through the voice playing unit when the user name is the same as the vocabulary to be converted in the user name library so as to confirm whether the pinyin is correct or not to the user;
the instruction receiving subunit is used for receiving a judging instruction fed back by a user, and judging the instruction to be a correct instruction or an error;
the conversion subunit is used for converting the vocabulary to be converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted when the instruction is judged to be correct; and
when the judging instruction is wrong, correcting the polyphones in the user name which is the same as the vocabulary to be converted into another pinyin, and then playing the corrected pinyin through the voice playing unit to confirm whether the pinyin is correct or not to the user until the judging instruction is correct, and converting the vocabulary to be converted into the pinyin according to the pinyin played by the voice playing unit when the judging instruction is correct.
The function implementation of each module in the device corresponds to each step in the embodiment of the method for converting pinyin of Chinese characters, and the function and implementation process are not described here again.
Furthermore, the invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores a Chinese character pinyin conversion program thereon, wherein the computer readable storage medium stores the Chinese character pinyin conversion program, when executed by a processor, implements the steps of the Chinese character pinyin conversion method as in any of the embodiments described above.
The method implemented when the pinyin conversion program is executed may refer to various embodiments of the pinyin conversion method of the present invention, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (9)

1. A Chinese character pinyin conversion method is characterized by comprising the following steps:
acquiring a word to be converted, wherein the word to be converted is information input in an input box distinguished according to information types;
comparing the vocabulary to be converted with a preset polyphone library, and judging whether the vocabulary to be converted contains polyphones according to the comparison result;
if the vocabulary to be converted contains polyphone, acquiring the part-of-speech type of the vocabulary to be converted, and calling a special dictionary corresponding to the part-of-speech type;
converting the polyphone words in the vocabulary to be converted into pinyin according to the pinyin corresponding to the polyphone words in the vocabulary to be converted in the special dictionary, and converting the non-polyphone words in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library;
the step of obtaining the part-of-speech category of the vocabulary to be converted and calling a special dictionary corresponding to the part-of-speech category comprises the following steps:
determining an input information type corresponding to the vocabulary to be converted according to the information type of an input box where the vocabulary to be converted is located;
and determining the part-of-speech class of the vocabulary to be converted according to the input information type, and calling a special dictionary corresponding to the part-of-speech class, wherein the part-of-speech class comprises name nouns and non-name nouns, the non-name nouns at least comprise place nouns and mechanism nouns, and the part-of-speech class corresponds to one or more special dictionaries.
2. The method for converting pinyin for Chinese characters according to claim 1, wherein said step of comparing said vocabulary to be converted with a preset polyphonic word stock and determining whether said vocabulary to be converted contains polyphonic words according to the comparison result comprises:
comparing each Chinese character in the vocabulary to be converted with a preset polyphone library respectively, and judging whether the Chinese characters in the vocabulary to be converted are the same as polyphones in the polyphone library;
if the Chinese characters in the vocabulary to be converted are judged to be the same as the polyphones in the polyphone library, the vocabulary to be converted is judged to contain the polyphones.
3. The method for converting pinyin for a chinese character according to claim 1, wherein said specific dictionary includes a surname dictionary corresponding to name nouns, and said method for converting pinyin for a chinese character further includes the steps of, if said vocabulary to be converted includes polyphone, obtaining a part-of-speech class of said vocabulary to be converted and retrieving a specific dictionary corresponding to said part-of-speech class:
acquiring a Chinese surname library, wherein the Chinese surname library comprises a plurality of surnames and pinyin corresponding to each surname;
comparing surnames in the Chinese surname library with the polyphonic character library, extracting surnames containing polyphonic characters, and obtaining pinyin of the polyphonic characters in the surnames;
and storing the pinyin of the polyphone in the surname dictionary.
4. The method for converting pinyin for a chinese character of claim 3, wherein said converting the polyphonic word to be converted into pinyin according to pinyin corresponding to the polyphonic word in the vocabulary to be converted in the specific dictionary and converting the non-polyphonic word in the vocabulary to be converted into pinyin according to a preset chinese character pinyin library comprises:
judging whether the part of speech class of the vocabulary to be converted is a name noun;
if the part of speech class of the vocabulary to be converted is a name noun, comparing the polyphone in the vocabulary to be converted and the Chinese characters before the polyphone as a field to be determined with each surname in the surname dictionary, and judging whether the continuous field of surnames in the surname dictionary is the same as the field to be determined;
if the continuous fields of surnames in the surname dictionary are the same as the fields to be determined, multi-tone words in the vocabulary to be converted are converted into pinyin according to the pinyin of the surnames which are the same as the fields to be determined, and non-multi-tone words in the vocabulary to be converted are converted into pinyin according to a Chinese character pinyin library.
5. The method of claim 4, wherein the special dictionary further comprises a user name library corresponding to name nouns, the step of converting polyphones in the vocabulary to be converted into pinyin according to pinyin corresponding to polyphones in the vocabulary to be converted in the special dictionary, and converting non-polyphones in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library further comprises:
if no continuous field of surnames in the surname dictionary is the same as the field to be determined, comparing the vocabulary to be converted with all user names in a user name library, and judging whether the user names in the user name library are the same as the vocabulary to be converted;
and if the user names in the user name library are the same as the vocabulary to be converted, converting the vocabulary to be converted into pinyin according to the pinyin of the user names which are the same as the vocabulary to be converted.
6. The method of claim 5, wherein if the user name is the same as the word to be converted in the user name library, converting the word to be converted into pinyin according to the pinyin of the same user name as the word to be converted comprises:
if the user name library has the user name which is the same as the vocabulary to be converted, the pinyin of the user name which is the same as the vocabulary to be converted is played through a voice playing unit so as to confirm whether the pinyin is correct or not to the user;
receiving a judging instruction fed back by a user, wherein the judging instruction is a correct instruction or an error;
when the judging instruction is correct, converting the vocabulary to be converted into pinyin according to the pinyin of the user name which is the same as the vocabulary to be converted;
when the judging instruction is wrong, correcting the polyphones in the user name which is the same as the vocabulary to be converted into another pinyin, and then playing the corrected pinyin through a voice playing unit to confirm whether the pinyin is correct or not to the user until the judging instruction is correct, and converting the vocabulary to be converted into the pinyin according to the pinyin played by the voice playing unit when the judging instruction is correct.
7. A pinyin conversion device for chinese characters, the pinyin conversion device comprising:
the first acquisition module is used for acquiring a word to be converted, wherein the word to be converted is information input in an input box distinguished according to information types;
the first comparison module is used for comparing the vocabulary to be converted with a preset polyphone library and judging whether the vocabulary to be converted contains polyphones according to the comparison result;
the second acquisition module is used for acquiring part-of-speech types of the vocabulary to be converted when the vocabulary to be converted contains polyphone, and calling a special dictionary corresponding to the part-of-speech types;
the conversion module is used for converting the polyphone words to be converted into pinyin according to the pinyin corresponding to the polyphone words in the vocabulary to be converted in the special dictionary, and converting the non-polyphone words in the vocabulary to be converted into pinyin according to a preset Chinese character pinyin library;
wherein, the second acquisition module includes:
the acquisition unit is used for determining the input information type corresponding to the vocabulary to be converted according to the information type of the input box where the vocabulary to be converted is located;
the calling unit is used for determining the part-of-speech category of the vocabulary to be converted according to the input information type, calling the special dictionary corresponding to the part-of-speech category, wherein the part-of-speech category comprises name nouns and non-name nouns, the non-name nouns at least comprise place nouns and mechanism nouns, and the part-of-speech category corresponds to one or more special dictionaries.
8. A computer terminal comprising a processor, a memory, and a chinese pinyin conversion program stored on the memory and executable by the processor, wherein the chinese pinyin conversion program when executed by the processor implements the steps of the chinese pinyin conversion method of any one of claims 1 to 6.
9. A computer readable storage medium, wherein a chinese pinyin conversion program is stored on the computer readable storage medium, wherein the chinese pinyin conversion program, when executed by a processor, implements the steps of the chinese pinyin conversion method of any one of claims 1 to 6.
CN201910103354.1A 2019-01-31 2019-01-31 Chinese character pinyin conversion method, device, terminal and computer readable storage medium Active CN109933215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910103354.1A CN109933215B (en) 2019-01-31 2019-01-31 Chinese character pinyin conversion method, device, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910103354.1A CN109933215B (en) 2019-01-31 2019-01-31 Chinese character pinyin conversion method, device, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109933215A CN109933215A (en) 2019-06-25
CN109933215B true CN109933215B (en) 2023-08-15

Family

ID=66985488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910103354.1A Active CN109933215B (en) 2019-01-31 2019-01-31 Chinese character pinyin conversion method, device, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109933215B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291281B (en) * 2019-07-09 2023-11-03 钉钉控股(开曼)有限公司 Voice broadcasting and voice broadcasting content setting method and device
CN110569501A (en) * 2019-07-30 2019-12-13 平安科技(深圳)有限公司 user account generation method, device, medium and computer equipment
CN110728120A (en) * 2019-09-06 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Method, device and storage medium for automatically filling pinyin in certificate identification process
CN112632967A (en) * 2020-12-30 2021-04-09 广东德诚科教有限公司 Chinese pinyin automatic generation method and device oriented to set strategy
CN114999450A (en) * 2022-05-24 2022-09-02 网易有道信息技术(北京)有限公司 Homomorphic and heteromorphic word recognition method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105336322A (en) * 2015-09-30 2016-02-17 百度在线网络技术(北京)有限公司 Polyphone model training method, and speech synthesis method and device
CN107193789A (en) * 2017-05-22 2017-09-22 上海携程金融信息服务有限公司 Chinese converted Chinese phonetic transcription and system containing polyphone

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105336322A (en) * 2015-09-30 2016-02-17 百度在线网络技术(北京)有限公司 Polyphone model training method, and speech synthesis method and device
CN107193789A (en) * 2017-05-22 2017-09-22 上海携程金融信息服务有限公司 Chinese converted Chinese phonetic transcription and system containing polyphone

Also Published As

Publication number Publication date
CN109933215A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN109933215B (en) Chinese character pinyin conversion method, device, terminal and computer readable storage medium
CN110164435B (en) Speech recognition method, device, equipment and computer readable storage medium
TWI296793B (en) Speech recognition assisted autocompletion of composite characters
US8909536B2 (en) Methods and systems for speech-enabling a human-to-machine interface
KR101109265B1 (en) Method for entering text
EP2184686A1 (en) Method and system for generating derivative words
US20120197629A1 (en) Speech translation system, first terminal apparatus, speech recognition server, translation server, and speech synthesis server
US20080147380A1 (en) Method, Apparatus and Computer Program Product for Providing Flexible Text Based Language Identification
WO2014201834A1 (en) Method and device of matching speech input to text
CN109326284B (en) Voice search method, apparatus and storage medium
KR101030831B1 (en) Method and apparatus for providing foreign language text display when encoding is not available
CN110827803A (en) Method, device and equipment for constructing dialect pronunciation dictionary and readable storage medium
US20060033644A1 (en) System and method for filtering far east languages
CN1359514A (en) Multimodal data input device
US20090276219A1 (en) Voice input system and voice input method
CN114281979A (en) Text processing method, device and equipment for generating text abstract and storage medium
CN109712613B (en) Semantic analysis library updating method and device and electronic equipment
CN110827815B (en) Voice recognition method, terminal, system and computer storage medium
JP2002366543A (en) Document generation system
CN111354339A (en) Method, device and equipment for constructing vocabulary phoneme table and storage medium
CN112272847A (en) Error conversion dictionary making system
CN110069762A (en) A kind of document polyphone sort method, device, medium and electronic equipment
JP4622861B2 (en) Voice input system, voice input method, and voice input program
TWI307845B (en) Directory assistant method and apparatus for providing directory entry information, and computer readable medium storing thereon related instructions
JP2018005368A (en) Output mode determination system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant