WO2020258652A1 - 字符替换方法、系统、计算机设备及计算机可读存储介质 - Google Patents

字符替换方法、系统、计算机设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2020258652A1
WO2020258652A1 PCT/CN2019/117404 CN2019117404W WO2020258652A1 WO 2020258652 A1 WO2020258652 A1 WO 2020258652A1 CN 2019117404 W CN2019117404 W CN 2019117404W WO 2020258652 A1 WO2020258652 A1 WO 2020258652A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
characters
replacement
query
found
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.)
Ceased
Application number
PCT/CN2019/117404
Other languages
English (en)
French (fr)
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
Publication of WO2020258652A1 publication Critical patent/WO2020258652A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Definitions

  • the embodiments of the present application relate to the field of data processing technology, and in particular, to a character replacement method, system, computer device, and computer-readable storage medium.
  • the purpose of the embodiments of the present application is to provide a character replacement method, system, computer equipment and non-volatile computer-readable storage medium, which can replace multiple identical original characters with different new characters at the same time , Thereby reducing the cumbersome degree of character replacement.
  • an embodiment of the present application provides a character replacement method, which includes the following steps:
  • N query characters and N replacement characters input by the user where the N query characters include at least two identical query characters, and the N replacement characters include at least two different replacement characters, where N is A natural number greater than or equal to 2;
  • the found character is correspondingly replaced with the replacement character, wherein the found character is correspondingly replaced
  • the replacement characters are specifically:
  • the obtained replacement character is used as the target replacement character to replace the found character.
  • an embodiment of the present application also provides a character replacement system, including:
  • the acquiring module is used to acquire N query characters and N replacement characters input by the user, wherein the N query characters include at least two identical query characters, and the number of the N replacement characters is the same as the number of the query characters The number of is the same, and the replacement characters include at least two different replacement characters, and N is a natural number greater than or equal to 2;
  • the search module is used to search the text information whether there is a character matching the search character by using the search character as the search condition;
  • the replacement module is used to replace the found character with the replacement character corresponding to the position of the found character in the text information when there is a character matching the query character, wherein
  • the corresponding replacement of the received character with the replacement character is specifically:
  • the obtained replacement character is used as the target replacement character to replace the found character.
  • an embodiment of the present application also provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, and the processor executes the computer-readable instructions.
  • N query characters and N replacement characters input by the user where the N query characters include at least two identical query characters, and the N replacement characters include at least two different replacement characters, where N is A natural number greater than or equal to 2;
  • the found character is correspondingly replaced with the replacement character, wherein the found character is correspondingly replaced
  • the replacement characters are specifically:
  • the obtained replacement character is used as the target replacement character to replace the found character.
  • the embodiments of the present application also provide a non-volatile computer-readable storage medium.
  • the non-volatile computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions may Is executed by at least one processor, so that the at least one processor executes the following steps:
  • N query characters and N replacement characters input by the user where the N query characters include at least two identical query characters, and the N replacement characters include at least two different replacement characters, where N is A natural number greater than or equal to 2;
  • the found character is correspondingly replaced with the replacement character, wherein the found character is correspondingly replaced
  • the replacement characters are specifically:
  • the obtained replacement character is used as the target replacement character to replace the found character.
  • FIG. 1 is a schematic diagram of the implementation process of the first embodiment of the character replacement method of this application.
  • FIG. 2 is a schematic diagram of the implementation process of the second embodiment of the character replacement method of this application.
  • FIG. 3 is a schematic diagram of the implementation process of the third embodiment of the character replacement method of this application.
  • FIG. 4 is a schematic diagram of the implementation process of the fourth embodiment of the character replacement method of this application.
  • FIG. 5 is a schematic diagram of program modules of a character replacement system according to an embodiment of this application.
  • FIG. 6 is a schematic diagram of the hardware structure of a computer device according to an embodiment of the application.
  • FIG. 1 shows a flowchart of a character replacement method in Embodiment 1 of the present application. It can be understood that the flowchart in this method embodiment is not used to limit the order of execution of the steps.
  • the character replacement system (hereinafter referred to as "replacement system” for short) is used as an exemplary description below, and the replacement system can be applied to computer equipment. details as follows:
  • Step S100 Obtain N query characters and N replacement characters input by the user, where the N query characters include at least two identical query characters, and the number of the N replacement characters is equal to the number of the query characters.
  • the numbers are the same, and the replacement characters include at least two different replacement characters, and N is a natural number greater than or equal to 2.
  • the query character is a character to be replaced in the text information
  • the query character includes at least two identical characters.
  • the text information includes the character "abcdefgab". If the user wants to add the text information If the two characters "a" in "a” are replaced at one time, the two characters "a" are the query characters.
  • the replacement character is a character that replaces the original character in the text information.
  • the characters "c” and “d” are the replacement characters.
  • the replacement characters include at least two different characters.
  • multiple identical characters can be directly input, or the query character can be represented by inputting only one character and a character representing the number of characters. Examples are as follows:
  • the input multiple characters can be separated by a separator used to separate.
  • the separator can be a comma, a semicolon, a comma, or other punctuation marks. It can be symbols such as space and line feed formed by clicking the space bar and enter key on the keyboard.
  • multiple input characters can also be separated by a separator used to separate them.
  • the characters may be words, letters, words, or other character units that can form the content of text information.
  • Step S102 using the query character as a query condition to search for whether there is a character matching the query character in the text information.
  • a traversal search is performed in the text information to determine whether there is a character that matches the query character.
  • step S104 when traversing and searching for characters that match the query characters in the text information, if the same number of matching characters as the query characters are found in the text information, then no further Search for the character in the text information whether it matches the query character, but directly execute step S104, that is, according to the position of the found character in the text information, replace the found character with The replacement character.
  • Step S104 When there is a character matching the query character, according to the position of the found character in the text information, the found character is correspondingly replaced with the replacement character, wherein the found character
  • the character corresponding to the replacement character is specifically:
  • the obtained replacement character is used as the target replacement character to replace the found character.
  • the position of the found character in the text information is acquired, and the position is the sequence information of the found character in the text information. Examples are as follows:
  • the text information is "abcdefgab" and the matched character is "a", the position of the first matching character "a” found in the text information is the "first position” in the text information, search The position of the second matching character "a” in the text information is the "seventh position” in the text information, that is to say, the "first position” and "seventh position” are the search The position of the arrived character in the text message.
  • the found character matching the query character can be replaced with the corresponding character in the replacement character New characters.
  • the first original character matching the query character is found, the first original character matching the query character is first replaced with the first character in the replacement character , And then use the preset semantic model to determine whether the sentence containing the first character in the replacement character is legal.
  • the first original character that matches the query character if it is illegal, continue to replace the first original character that matches the query character with the second character in the replacement character, and then use the
  • the preset semantic model judges whether the sentence containing the second character in the replacement character is legal, and if it is legal, the first character in the replacement character is used as the target replacement character to replace the first character in the text information.
  • An original character matching the query character if it is still illegal, repeat the above steps until the target replacement character is found.
  • the semantic model is an n-gram model, which is a language model constructed by calculating Maximum Likelihood Estimate (Maximum Likelihood Estimate), which can also be used to calculate the legal probability of a sentence model.
  • Maximum Likelihood Estimate Maximum Likelihood Estimate
  • the model is used to calculate the probability of the validity of the sentence, and then the calculated probability is compared with a threshold. If the calculated probability is greater than the threshold, the sentence is determined to be legal If the calculated probability is less than the threshold, it is determined that the sentence is illegal, and the threshold can be obtained through training. It should be noted that the sentence in this embodiment is legal, which means that the grammar and semantics of the sentence are reasonable, and the meaning of the sentence is clear and correct.
  • the query character After the first original character is replaced, the query character will continue to be used as the query condition, and the traversal query in the text information will continue from the position where the first original character is obtained to find the second and the The character matched by the query character, when the second character matching the query character is found, replace the second original character matching the query character with the character in the replacement character, and so on Until the replacement of all characters is completed, the specific character replacement method has been described in detail above and will not be repeated here.
  • the matching characters after finding the same number of matching characters as the query characters in the text information, the matching characters are replaced with the matching characters according to the position of each found matching character in the text information.
  • each character in the replacement characters can also be replaced in parallel, that is, multiple characters can be replaced at one time or all characters can be replaced at one time.
  • the character replacement method proposed in this embodiment of the present application obtains query characters and replacement characters input by a user, wherein the query characters include at least two identical characters, and the number of replacement characters is greater than the number of the query characters.
  • the number of characters is the same, and the replacement characters include at least two different characters;
  • the text information is searched for whether there is a character that matches the query character with the query character as the query condition; and when there is a character that matches the query character;
  • searching for a character matched by a character the character matching the search character is replaced with the replacement character, so that multiple identical original characters can be replaced with different new characters at the same time, without the need to change each original character Re-input, search and replace operations, thereby reducing the cumbersome degree of character replacement.
  • FIG. 2 is a schematic diagram of the implementation process of the second embodiment of the character replacement method of the present application.
  • the execution order of the steps in the flowchart shown in FIG. 2 can be changed, and some steps can be omitted.
  • the character replacement system (hereinafter referred to as “replacement system” for short) is used as an exemplary description below, and the replacement system can be applied to a server. details as follows:
  • Step S200 Obtain N query characters and N replacement characters input by the user, wherein the N query characters include at least two identical query characters, and the number of the N replacement characters is equal to the number of the query characters.
  • the numbers are the same, and the replacement characters include at least two different replacement characters, and N is a natural number greater than or equal to 2.
  • Step S202 using the query character as the query condition to search the text information for whether there is a character matching the query character.
  • steps S200-S202 are similar to steps S100-S102, and will not be repeated in this embodiment.
  • Step S204 When there are characters matching the query characters, it is determined whether the number of characters found is the same as the number of query characters.
  • Step S206 If the number of characters found is the same as the number of the query characters, the characters found are replaced with the replacement characters according to the position of the found characters in the text information. .
  • the positions of the found characters in the text information can be used to group the found characters one by one. Replace with each character in the replacement character.
  • the text information consists of the following characters: "absdefcdabcejgalv”, the query character is "aa”, and the replacement character is "zm”.
  • the found character is replaced When, first replace the character "a" in the first position of the text message with the character "z”, and then determine whether the replaced sentence is legal. If it is legal, use the character "z" as the target replacement character.
  • a prompt message may be output to remind the user that the text information There is not such a large number of matching characters.
  • the prompt message may prompt "the number of matching characters is insufficient” or "please reduce the number of query characters" in a pop-up window.
  • the found character is correspondingly replaced with the replacement character.
  • the text information consists of the following characters: "abcdefah”, the query character is "aaa”, and the replacement character is "zmg”.
  • the found The first matching character "a” is located in the first position in the text information
  • the second matching character "a” found is located in the seventh position in the text information
  • the third matching character is not found .
  • replacing the found character first replace the character "a” in the first position of the text message with the character "z”, and then judge whether the replaced sentence is legal, if it is legal, replace The character "z" is used as the target replacement character.
  • the character replacement method proposed in this embodiment of the present application determines whether there are enough matching characters in the text information before replacing the characters. When there are enough matching characters in the text information, the matching characters will be found One-to-one correspondence is replaced with each character in the replacement character. When there are not enough matching characters in the text information, a prompt message can be output to prompt the user.
  • FIG. 3 is a schematic diagram of the implementation process of the third embodiment of the character replacement method of the present application.
  • the execution order of the steps in the flowchart shown in FIG. 3 can be changed, and some steps can be omitted.
  • the character replacement system (hereinafter referred to as “replacement system” for short) is used as an exemplary description below, and the replacement system can be applied to a server. details as follows:
  • Step S300 Obtain N query characters and N replacement characters input by the user, where the N query characters include at least two identical query characters, and the number of the N replacement characters is equal to the number of the query characters.
  • the numbers are the same, and the replacement characters include at least two different replacement characters, and N is a natural number greater than or equal to 2.
  • step S300 is similar to step S100, and will not be repeated in this embodiment.
  • Step S302 using the query character as a query condition, and searching the text information for whether there is a character matching the query character according to the location information.
  • the query character also includes position information of the character to be replaced, and the character to be replaced is a character in the text information that needs to be replaced with a new character (ie, the replacement character in this application).
  • the position information is the position of the character to be replaced in the text information.
  • the position information in the query character is expressed in the following manner: the query character is "a1, a4", and the query character means that the first character in the text information needs to be " a", and the fourth character "a", replaced with new characters.
  • the query character When the query character is used as the query condition, through traversal search in the text information, when a character matching the query character is found, it is further necessary to determine whether the found character belongs to the query according to the position information. The character that matches the character.
  • Step S304 When there is a character matching the query character, according to the position of the found character in the text information, the found character is correspondingly replaced with the replacement character.
  • step S304 is similar to step S104, and will not be repeated in this embodiment.
  • the character replacement method proposed in this embodiment of the present application makes the character replacement more flexible by inserting the position information of the character to be replaced in the query information.
  • FIG. 4 is a schematic diagram of the implementation process of the third embodiment of the character replacement method of the present application.
  • the execution order of the steps in the flowchart shown in FIG. 4 can be changed, and some steps can be omitted.
  • the character replacement system (hereinafter referred to as “replacement system” for short) is used as an exemplary description below, and the replacement system can be applied to a server. details as follows:
  • Step S400 Provide an input interface for the user to input the query character and the replacement character.
  • an input interface can be provided to the user through the currently operated editing tool, and the user can input the query character and the replacement through the input interface. character.
  • Step S402 Obtain N query characters and N replacement characters input by the user, where the N query characters include at least two identical query characters, and the number of the N replacement characters is equal to the number of the query characters.
  • the numbers are the same, and the replacement characters include at least two different replacement characters, and N is a natural number greater than or equal to 2.
  • Step S404 using the query character as a query condition to search the text information for whether there is a character matching the query character;
  • Step S406 When there is a character matching the query character, according to the position of the found character in the text information, the found character is correspondingly replaced with the replacement character.
  • steps S402-S406 are similar to the steps S100-S104, and will not be repeated in this embodiment.
  • the character replacement method proposed in the embodiment of the present application provides an input interface so that the user can conveniently input the query character and the replacement character.
  • FIG. 5 shows a schematic diagram of program modules of a character replacement system 500 (hereinafter referred to as "replacement system” 500) according to an embodiment of the present application.
  • the replacement system 500 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the application , And can realize the above-mentioned character replacement method.
  • the program module referred to in the embodiments of the present application refers to a series of computer-readable instruction instruction segments capable of completing specific functions, and is more suitable for describing the execution process of the character replacement method in the storage medium than the program itself. The following description will specifically introduce the functions of each program module in this embodiment:
  • the obtaining module 501 is configured to obtain N query characters and N replacement characters input by a user, wherein the N query characters include at least two identical query characters, and the number of the N replacement characters is the same as the number of the N replacement characters.
  • the number of query characters is the same, and the replacement characters include at least two different replacement characters, and N being a natural number greater than or equal to 2 includes at least.
  • the query character is a character to be replaced in the text information
  • the query character includes at least two identical characters.
  • the text information includes the character "abcdefgab". If the user wants to add the text information If the two characters "a" in "a” are replaced at one time, the two characters "a" are the query characters.
  • the replacement character is a character that replaces the original character in the text information.
  • the replacement characters include at least two different characters.
  • multiple identical characters can be directly input, or the query character can be represented by inputting only one character and a character representing the number of characters. Examples are as follows:
  • the input multiple characters can be separated by a separator used to separate.
  • the separator can be a comma, a semicolon, a comma, or other punctuation marks. It can be symbols such as space and line feed formed by clicking the space bar and enter key on the keyboard.
  • multiple input characters can also be separated by a separator used to separate them.
  • the characters may be words, letters, words, or other character units that can form the content of text information.
  • the searching module 502 searches the text information for whether there is a character matching the search character by using the search character as a search condition.
  • a traversal search is performed in the text information to determine whether there is a character that matches the query character.
  • the replacement module 503 is configured to replace the found character with the replacement character according to the position of the found character in the text information when there is a character matching the query character.
  • the position of the found character in the text information is acquired, and the position is the sequence information of the found character in the text information. Examples are as follows:
  • the text information is "abcdefgab" and the matched character is "a", the position of the first matching character "a” found in the text information is the "first position” in the text information, search The position of the second matching character "a” in the text information is the "seventh position” in the text information, that is to say, the "first position” and "seventh position” are the search The position of the arrived character in the text message.
  • the found character matching the query character can be replaced with the corresponding character in the replacement character New characters.
  • the first original character matching the query character is found, the first original character matching the query character is first replaced with the first character in the replacement character , And then use the preset semantic model to determine whether the sentence containing the first character in the replacement character is legal.
  • the first original character that matches the query character if it is illegal, continue to replace the first original character that matches the query character with the second character in the replacement character, and then use the
  • the preset semantic model judges whether the sentence containing the second character in the replacement character is legal, and if it is legal, the first character in the replacement character is used as the target replacement character to replace the first character in the text information.
  • An original character matching the query character if it is still illegal, repeat the above steps until the target replacement character is found.
  • the semantic model is an n-gram model, which is a language model constructed by calculating Maximum Likelihood Estimate (Maximum Likelihood Estimate), which can also be used to calculate the legal probability of a sentence model.
  • Maximum Likelihood Estimate Maximum Likelihood Estimate
  • the model is used to calculate the probability of the validity of the sentence, and then the calculated probability is compared with a threshold. If the calculated probability is greater than the threshold, the sentence is determined to be legal If the calculated probability is less than the threshold, it is determined that the sentence is illegal, and the threshold can be obtained through training. It should be noted that the sentence in this embodiment is legal, which means that the grammar and semantics of the sentence are reasonable, and the meaning of the sentence is clear and correct.
  • the query character After the first original character is replaced, the query character will continue to be used as the query condition, and the traversal query in the text information will continue from the position where the first original character is obtained to find the second and the The character matched by the query character, when the second character matching the query character is found, replace the second original character matching the query character with the character in the replacement character, and so on Until the replacement of all characters is completed, the specific character replacement method has been described in detail above and will not be repeated here.
  • the matching characters after finding the same number of matching characters as the query characters in the text information, the matching characters are replaced with the matching characters according to the position of each found matching character in the text information.
  • each character in the replacement characters can also be replaced in parallel, that is, multiple characters can be replaced at one time or all characters can be replaced at one time.
  • the replacement module 503 is further configured to determine whether the number of characters found is the same as the number of the query characters when there are characters that match the query characters; and When the number of found characters is the same as the number of search characters, according to the position of the found characters in the text information, the found characters are correspondingly replaced with the replacement characters.
  • the positions of the found characters in the text information can be replaced with one-to-one correspondence of the found characters Each character in the replacement character.
  • the position is the sequence of the found characters in the text information.
  • the text information consists of the following characters: "absdefcdabcejgalv”, the query character is "aa”, and the replacement character is "zm”.
  • the found character is replaced When, first replace the character "a" in the first position of the text message with the character "z”, and then determine whether the replaced sentence is legal. If it is legal, use the character "z" as the target replacement character.
  • a prompt message may be output to remind the user that the text information There is not such a large number of matching characters.
  • the prompt message may prompt "the number of matching characters is insufficient” or "please reduce the number of query characters" in a pop-up window.
  • the characters when the text information is traversed, and it is found that the number of matching characters found is less than the number of the query characters, the characters can still be found in the The position in the text information corresponds to replacing the found character with the replacement character.
  • the text information consists of the following characters: "abcdefah”, the query character is "aaa”, and the replacement character is "zmg”.
  • the found The first matching character "a” is located in the first position in the text information
  • the second matching character "a” found is located in the seventh position in the text information
  • the third matching character is not found .
  • replacing the found character first replace the character "a” in the first position of the text message with the character "z”, and then judge whether the replaced sentence is legal, if it is legal, replace The character "z" is used as the target replacement character.
  • the search module 502 is further configured to use the search character as a search condition, and search for in the text information according to the location information whether there is a match with the search character. character.
  • the query character also includes position information of the character to be replaced, and the character to be replaced is a character in the text information that needs to be replaced with a new character (ie, the replacement character in this application).
  • the position information is the position of the character to be replaced in the text information.
  • the position information in the query character is expressed in the following manner: the query character is "a1, a4", and the query character means that the first character in the text information needs to be " a", and the fourth character "a", replaced with new characters.
  • the query character When the query character is used as the query condition, through traversal search in the text information, when a character matching the query character is found, it is further necessary to determine whether the found character belongs to the query according to the position information. The character that matches the character.
  • the replacement system 500 further includes:
  • the providing module is used to provide an input interface for the user to input the query character and the replacement character.
  • an input interface can be provided to the user through the currently operated editing tool, and the user can input the query character and the replacement through the input interface. character.
  • the character replacement system proposed in this embodiment of the present application acquires query characters and replacement characters input by a user, wherein the query characters include at least two identical characters, and the number of replacement characters is greater than the number of the query characters.
  • the number of characters is the same, and the replacement characters include at least two different characters;
  • the text information is searched for whether there is a character that matches the query character with the query character as the query condition; and when there is a character that matches the query character;
  • searching for a character matched by a character the character matching the search character is replaced with the replacement character, so that multiple identical original characters can be replaced with different new characters at the same time, without the need to change each original character Re-input, search and replace operations, thereby reducing the cumbersome degree of character replacement.
  • FIG. 6 is a schematic diagram of the hardware architecture of a computer device 600 according to an embodiment of the present application.
  • the computer device 600 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions.
  • the computer device 600 at least includes, but is not limited to, a memory 601, a processor 602, a network interface 603, and a character replacement system 604 that can communicate with each other through a system bus. among them:
  • the memory 601 includes at least one type of non-volatile computer-readable storage medium.
  • the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), Random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk Wait.
  • the memory 601 may be an internal storage unit of the computer device 600, such as a hard disk or memory of the computer device 600.
  • the memory 601 may also be an external storage device of the computer device 600, for example, a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD card, Flash Card, etc.
  • the memory 601 may also include both the internal storage unit of the computer device 600 and its external storage device.
  • the memory 601 is generally used to store the operating system and various application software installed in the computer device 600, such as the program code of the character replacement system 604.
  • the memory 601 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 602 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 602 is generally used to control the overall operation of the computer device 600.
  • the processor 602 is configured to run the program code or process data stored in the memory 601, for example, to run the character replacement system 604, so as to implement the character replacement method in each of the foregoing embodiments.
  • the network interface 603 may include a wireless network interface or a wired network interface, and the network interface 603 is generally used to establish a communication connection between the computer device 600 and other electronic devices.
  • the network interface 603 is used to connect the computer device 600 to an external terminal through a network, and to establish a data transmission channel and a communication connection between the computer device 600 and the external terminal.
  • the network may be Intranet, Internet, Global System of Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G Network, Bluetooth (Bluetooth), Wi-Fi and other wireless or wired networks.
  • FIG. 6 only shows a computer device 600 with components 601-604, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
  • the character replacement system 604 stored in the memory 601 can also be divided into one or more program modules.
  • the one or more program modules are stored in the memory 601 and are composed of one or more program modules.
  • a processor (processor 602 in this embodiment) is executed to complete the character replacement method of this application.
  • This embodiment also provides a non-volatile computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory ( SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application mall, etc., on which storage There are computer-readable instructions, and the corresponding functions are realized when the program is executed by the processor.
  • the non-volatile computer-readable storage medium of this embodiment is used to store the character replacement system 500 or 604, so as to implement the following steps when executed by a processor:
  • N query characters and N replacement characters input by the user where the N query characters include at least two identical query characters, and the N replacement characters include at least two different replacement characters, where N is A natural number greater than or equal to 2;
  • the found character is correspondingly replaced with the replacement character, wherein the found character is correspondingly replaced
  • the replacement characters are specifically:
  • the obtained replacement character is used as the target replacement character to replace the found character.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种字符替换方法,包括以下步骤:获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符;以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。

Description

字符替换方法、系统、计算机设备及计算机可读存储介质
本申请要求于2019年6月25日提交中国专利局、申请号为201910553284.X、发明名称为“字符替换方法、系统、计算机设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及数据处理技术领域,尤其涉及一种字符替换方法、系统、计算机设备及计算机可读存储介质。
背景技术
在编辑文本时,如需对其中的字符进行替换,通常是针对某一需替换原有字符并以该原有字符作为查询条件,遍历整个编辑区域的文本信息进行查找,以查找到对应的原有字符,并用新字符替换所查找到的原有字符。然而,发明人意识到采用这种替换方法,当需要将文本信息中的多个相同的原有字符替换为不同的新字符时,则要针对每个相同的原有字符分别进行查找以及替换的步骤,由于需要进行多次查找及替换操作,因此无法实现将多个相同的原有字符同时替换为不同的新字符,从而增加了字符替换的繁琐程度。
发明内容
有鉴于此,本申请实施例的目的是提供一种字符替换方法、系统、计算机设备及非易失性计算机可读存储介质,能够实现将多个相同的原有字符同时替换为不同的新字符,从而减小字符替换的繁琐程度。
为实现上述目的,本申请实施例提供了一种字符替换方法,包括以下步骤:
获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
为实现上述目的,本申请实施例还提供了一种字符替换系统,包括:
获取模块,用于获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
查找模块,用于以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
替换模块,用于当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
为实现上述目的,本申请实施例还提供了一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到 的替换字符;
使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
为实现上述目的,本申请实施例还提供了一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质内存储有计算机可读指令,所述计算机可读指令可被至少一个处理器所执行,以使所述至少一个处理器执行如下步骤:
获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
附图说明
图1为本申请字符替换方法第一实施例的实施流程示意图。
图2为本申请字符替换方法第二实施例的实施流程示意图。
图3为本申请字符替换方法第三实施例的实施流程示意图。
图4为本申请字符替换方法第四实施例的实施流程示意图。
图5为本申请一实施方式的字符替换系统的程序模块示意图。
图6为本申请一实施方式的计算机设备的硬件结构示意图。
具体实施方式
参阅图1,示出了本申请实施例一之字符替换方法的流程图。可以理解,本方法实施 例中的流程图不用于对执行步骤的顺序进行限定。下面以字符替换系统(下文以“替换系统”简称)为执行主体进行示例性描述,所述替换系统可以应用于计算机设备中。具体如下:
步骤S100,获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数。
具体地,在通过文本编辑工具编辑文本信息时,当需要对文本信息中的多个原有字符进行替换时,获取用户输入的查询字符和替换字符。在本实施例中,所述查询字符为文本信息中的待替换的字符,所述查询字符包括至少两个相同的字符,比如,该文本信息中包括字符“abcdefgab”,若用户希望将文本信息中的两个字符“a”一次性替换掉,则两个字符“a”即为所述查询字符。所述替换字符为对文本信息中的原有字符进行替换的字符。比如,用户想将文本信息中的两个字符“a”依次替换为“c”、“d”,也即替换为“cbcdefgdb”,则字符“c”、“d”即为所述替换字符。在本实施例中,所述替换字符包括至少两个不同的字符。
在一实施例中,当输入所述查询字符时,可以直接输入多个相同的字符,也可以通过只输入一个字符以及代表该字符个数的字符来表示所述查询字符。举例如下:
在输入所述查询字符时,可以输入“A;A;A;A”,或者“A;4”等。在本实施例中,在输入所述查询字符时,可以通过用于起分隔作用的分隔符将输入的多个字符隔开,该分隔符可以为逗号、分号、顿号等标点符号,也可以为通过点击键盘上的空格键和回车键等按键所形成的如空格和换行符号等符号。在输入替换字符时,也可以通过用于起分隔作用的分隔符将输入的多个字符隔开。
在实施例中,字符可以为文字、字母、单词或其他能够组成文本信息内容的字符单元。
步骤S102,以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符。
具体地,以所述查询字符作为查询条件,在文本信息中进行遍历查找,判断是否存在与所述查询字符相匹配的字符。
在一实施方式中,在所述文本信息中遍历查找与所述查询字符相匹配的字符时,若在所述文本信息中查找到与所述查询字符个数相同的匹配字符,则不再继续在所述文本信息中查找是否与所述查询字符相匹配的字符,而是直接执行步骤S104,即按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
步骤S104,当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息 中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
具体地,当查找到所述查询字符匹配的字符时,获取查找到的字符在所述文本信息中的位置,该位置为查找到的字符在文本信息中的先后顺序信息。举例如下:
该文本信息为“abcdefgab”,匹配的字符为“a”,则查找到的第一个匹配字符“a”在所述文本信息中的位置为位于该文本信息中的“第一位”,查找到的第二个匹配字符“a”在所述文本信息中的位置为位于该文本信息中的“第七位”,也就是说,该“第一位”与“第七位”即为查找到的字符在所述文本信息中的位置。
在获取到查找到的字符在所述文本信息中的位置时,即可根据获取到的用户输入的替换字符,将查找到的与所述查询字符匹配的字符对应替换为所述替换字符中的新字符。在一实施方式中,在查找到第一个与所述查询字符匹配的原始字符时,先将该第一个与所述查询字符匹配的原始字符替换为所述替换字符中的第一个字符,然后使用预设的语义模型判断包含该替换字符中的第一个字符的句子是否合法,若合法,则将该替换字符中的第一个字符作为目标替换字符,用于替换该文本信息中的第一个与所述查询字符匹配的原始字符;若不合法,则继续将该第一个与所述查询字符匹配的原始字符替换为所述替换字符中的第二个字符,然后使用该预设的语义模型判断包含该替换字符中的第二个字符的句子是否合法,若合法,则将该替换字符中的第个个字符作为目标替换字符,用于替换该文本信息中的第一个与所述查询字符匹配的原始字符;若仍不合法,则重复上述步骤直到找到所述目标替换字符。
在本实施例中,该语义模型为n-gram模型,该n-gram模型是一个通过计算极大似然估计(Maximum Likelihood Estimate)构造语言模型,它也是一个可以用来计算一个句子合法概率的模型。在使用该模型判断句子是否合法时,具体通过该模型计算出句子合法性的概率,然后将计算的得到的概率与一个阈值进行比较,若该计算得到的概率大于该阈值,则判定该句子合法,该计算得到的概率小于该阈值,则判定该句子不合法,其中,该阈值可以通过训练得到。需要说明的是,本实施例中的句子合法,指的是句子的语法及语义合理,且句子表达的意思清楚无误。
在对第一个原有字符完成替换之后,会继续以所述查询字符为查询条件,从获取第一个原有字符的位置开始继续在文本信息中进行遍历查询以找到第二个与所述查询字符匹配的字符,在找到该第二个与所述查询字符匹配的字符时,将该第二个与所述查询字符匹配的原有字符替换为所述替换字符中的字符,以此类推,直到完成所有字符的替换为止,具体的字符替换方法在上文已详细描述,在此不再赘述。在另一实施方式中,可以先在文本信息中查找到与所述查询字符相同个数的匹配字符之后,再根据各个查找到的匹配字符在所述文本信息中的位置将该匹配字符替换为所述替换字符中的各个字符,当然,也可以采取并行的方式进行字符替换,即可以一次替换多个字符或者一次性替换所有的字符。
本申请本实施例所提出的字符替换方法,通过获取用户输入的查询字符以及替换字符,其中,所述查询字符包括至少两个相同的字符,所述替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的字符;以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及当存在与所述查询字符匹配的字符时,将与所述查询字符匹配的字符替换为所述替换字符,从而能够实现将多个相同的原有字符同时替换为不同的新字符,无需对每一个原有字符都重新进行输入、查找及替换的操作,从而减小字符替换的繁琐程度。
参阅图2,是本申请字符替换方法第二实施例的实施流程示意图。在本实施例中,根据不同的需求,图2所示的流程图中的步骤的执行顺序可以改变,某些步骤可以省略。下面以字符替换系统(下文以“替换系统”简称)为执行主体进行示例性描述,所述替换系统可以应用于服务器中。具体如下:
步骤S200,获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数。
步骤S202,以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符。
上述步骤S200-S202与步骤S100-S102类似,在本实施方式中不再赘述。
步骤S204,当存在与所述查询字符匹配的字符时,判断查找到的字符的个数是否与所述查询字符的个数相同。
具体地,在文本信息中查找与所述查询字符相匹配的字符时,当查找到匹配的字符时,需要记录当前查找到的字符是第几个匹配的字符,以便确定当前查找到的匹配字符的个数是否已足够,即判断查找到的字符的个数是否与所述查询字符的个数相同。
步骤S206,若查找到的字符的个数与所述查询字符的个数相同,则按照查找到的字符 在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
具体地,当在文本信息中查找到与所述查询字符的个数一样多的匹配字符时,即可按照查找到的字符在所述文本信息中的位置,将查找到的各个字符一一替换为所述替换字符中的各个字符。
举例如下:假设所述文本信息由如下字符组成:“absdefcdabcejgalv”,所述查询字符为“aa”,所述替换字符为“zm”,在对该文本信息进行遍历查询之后,可以得到查找到的第一个匹配的字符“a”位于该文本信息中的第一位,查找到的第二个匹配的字符“a”位于该文本信息中的第九位,则在对查找到的字符进行替换时,先将位于该文本信息中的第一位中的字符“a”替换为字符“z”,然后判断替换后的句子是否合法,若合法,则将该字符“z”作为目标替换字符,若不合法,则将第一位中的字符“a”替换为字符“m”,然后判断替换后的句子是否合法,若合法,则将该字符“m”作为目标替换字符。同理,在将位于该文本信息中的第九位中的字符“a”进行替换时,仍重复上述替换步骤,假设经替换后,该文本信息变为“z bsdefcd m bcejgalv”。
进一步地,在一实施方式中,当遍历完所述文本信息时,发现查找到的匹配字符的个数少于所述查询字符的个数时,可以输出提示消息,以提醒用户在文本信息中不存在这么多个数的匹配字符。优选地,该提示消息可以以弹窗的方式提示“匹配字符的个数不足”或“请减少查询字符的个数”等。
进一步地,在另一实施方式中,当遍历完所述文本信息时,发现查找到的匹配字符的个数少于所述查询字符的个数时,仍然可以按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
举例如下:假设所述文本信息由如下字符组成:“abcdefah”,所述查询字符为“aaa”,所述替换字符为“zmg”,在对该文本信息进行遍历查询之后,可以得到查找到的第一个匹配的字符“a”位于该文本信息中的第一位,查找到的第二个匹配的字符“a”位于该文本信息中的第七位,未查找到第三个匹配的字符,则在对查找到的字符进行替换时,先将位于该文本信息中的第一位中的字符“a”替换为字符“z”,然后判断替换后的句子是否合法,若合法,则将该字符“z”作为目标替换字符,若不合法,则将第一位中的字符“a”替换为字符“m”,然后判断替换后的句子是否合法,若合法,则将该字符“m”作为目标替换字符,若仍不合法,将第一位中的字符“a”替换为字符“g”,然后判断替换后的句子是否合法,若合法,则将该字符“g”作为目标替换字符。同理,在将位于该文本信息中的第七位中的字符“a”进行替换时,仍重复上述替换步骤,假设经替换后,该文本信息变为“zbcdefmh”。
本申请本实施例所提出的字符替换方法,通过在替换字符前,判断文本信息中是否存在足够个数的匹配字符,在文本信息中存在足够个数的匹配字符时,将查找到的匹配字符一一对应替换为所述替换字符中的各个字符,在文本信息中不存在足够个数的匹配字符时,可以输出提示消息提示用户。
参阅图3,是本申请字符替换方法第三实施例的实施流程示意图。在本实施例中,根据不同的需求,图3所示的流程图中的步骤的执行顺序可以改变,某些步骤可以省略。下面以字符替换系统(下文以“替换系统”简称)为执行主体进行示例性描述,所述替换系统可以应用于服务器中。具体如下:
步骤S300,获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数。
上述步骤S300与步骤S100类似,在本实施方式中不再赘述。
步骤S302,以所述查询字符为查询条件,根据所述位置信息在所述文本信息中查找是否存在与所述查询字符相匹配的字符。
具体地,所述查询字符还包括待替换字符的位置信息,所述待替换字符为文本信息中需要使用新的字符(即本申请中的替换字符)将该待替换字符进行替换的字符。所述位置信息为所述待替换字符在所述文本信息中的位置。在一具体实施方式中,所述查询字符中的位置信息以如下方式表示:所述查询字符为“a1,a4”,该查询字符代表的意思为,需要将文本信息中的第一个字符“a”,及第4个字符“a”,替换为新字符。
在以查询字符为查询条件时,通过在文本信息中进行遍历查找,在查找到与该查询字符相匹配的字符时,进一步需要根据该位置信息来判定该查找到的字符是否属于与所述查询字符相匹配的字符。
举例如下:假设所述文本信息为“abcdaeaf”,所述查询字符为“a1,a4”,当在文本信息中进行遍历查找时,查找到第一个字符“a”时,发现该字符“a”的位置信息与查询字符的位置信息相同,故可将该第一个字符“a”作为与所述查询字符相匹配的字符,继续查找时,查找到第二个字符“a”时,发现该字符“a”的位置信息与查询字符的位置信息不相同,不将该第二个字符“a”作为与所述查询字符相匹配的字符。
步骤S304,当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
上述步骤S304与步骤S104类似,在本实施方式中不再赘述。
本申请本实施例所提出的字符替换方法,通过在查询信息中插入待替换字符的位置信 息,使得字符的替换更加灵活。
参阅图4,是本申请字符替换方法第三实施例的实施流程示意图。在本实施例中,根据不同的需求,图4所示的流程图中的步骤的执行顺序可以改变,某些步骤可以省略。下面以字符替换系统(下文以“替换系统”简称)为执行主体进行示例性描述,所述替换系统可以应用于服务器中。具体如下:
步骤S400,提供一输入界面,以供用户输入所述查询字符与所述替换字符。
具体地,在需要对文本信息中的多个原有字符进行替换之前,可以通过当前所操作的编辑工具向用户提供一输入界面,用户通过该输入界面,可以输入所述查询字符与所述替换字符。
步骤S402,获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数。
步骤S404,以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;
步骤S406,当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
上述步骤S402-S406与步骤S100-S104类似,在本实施方式中不再赘述。
本申请实施例所提出的字符替换方法,通过提供一输入界面,使得用户可以方便的输入所述查询字符与所述替换字符。
请参阅图5,示出了本申请实施例之字符替换系统500(以下简称为“替换系统”500)的程序模块示意图。在本实施例中,替换系统500可以包括或被分割成一个或多个程序模块,一个或者多个程序模块被存储于存储介质中,并由一个或多个处理器所执行,以完成本申请,并可实现上述字符替换方法。本申请实施例所称的程序模块是指能够完成特定功能的一系列计算机可读指令指令段,比程序本身更适合于描述字符替换方法在存储介质中的执行过程。以下描述将具体介绍本实施例各程序模块的功能:
获取模块501,用于获获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数包括至少。
具体地,在通过文本编辑工具编辑文本信息时,当需要对文本信息中的多个原有字符进行替换时,获取用户输入的查询字符和替换字符。在本实施例中,所述查询字符为文本 信息中的待替换的字符,所述查询字符包括至少两个相同的字符,比如,该文本信息中包括字符“abcdefgab”,若用户希望将文本信息中的两个字符“a”一次性替换掉,则两个字符“a”即为所述查询字符。所述替换字符为对文本信息中的原有字符进行替换的字符。比如,用户想将文本信息中的两个字符“a”依次替换为“c”、“d”,也即替换为“cbcdefgdb”,则字符“cd”即为所述替换字符。在本实施例中,所述替换字符包括至少两个不同的字符。
在一实施例中,当输入所述查询字符时,可以直接输入多个相同的字符,也可以通过只输入一个字符以及代表该字符个数的字符来表示所述查询字符。举例如下:
在输入所述查询字符时,可以输入“A;A;A;A”或者可以输入“A;4”等。在本实施例中,在输入所述查询字符时,可以通过用于起分隔作用的分隔符将输入的多个字符隔开,该分隔符可以为逗号、分号、顿号等标点符号,也可以为通过点击键盘上的空格键和回车键等按键所形成的如空格和换行符号等符号。在输入替换字符时,也可以通过用于起分隔作用的分隔符将输入的多个字符隔开。
在实施例中,字符可以为文字、字母、单词或其他能够组成文本信息内容的字符单元。
查找模块502,以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符。
具体地,以所述查询字符作为查询条件,在文本信息中进行遍历查找,判断是否存在与所述查询字符相匹配的字符。
在一实施方式中,在所述文本信息中遍历查找与所述查询字符相匹配的字符时,若在所述文本信息中查找到与所述查询字符个数相同的匹配字符,则不再继续在所述文本信息中查找是否与所述查询字符相匹配的字符,而是直接执行将与所述查询字符匹配的字符替换为所述替换字符的步骤。
替换模块503,用于当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
具体地,当查找到所述查询字符匹配的字符时,获取查找到的字符在所述文本信息中的位置,该位置为查找到的字符在文本信息中的先后顺序信息。举例如下:
该文本信息为“abcdefgab”,匹配的字符为“a”,则查找到的第一个匹配字符“a”在所述文本信息中的位置为位于该文本信息中的“第一位”,查找到的第二个匹配字符“a”在所述文本信息中的位置为位于该文本信息中的“第七位”,也就是说,该“第一位”与“第七位”即为查找到的字符在所述文本信息中的位置。
在获取到查找到的字符在所述文本信息中的位置时,即可根据获取到的用户输入的替 换字符,将查找到的与所述查询字符匹配的字符对应替换为所述替换字符中的新字符。在一实施方式中,在查找到第一个与所述查询字符匹配的原始字符时,先将该第一个与所述查询字符匹配的原始字符替换为所述替换字符中的第一个字符,然后使用预设的语义模型判断包含该替换字符中的第一个字符的句子是否合法,若合法,则将该替换字符中的第一个字符作为目标替换字符,用于替换该文本信息中的第一个与所述查询字符匹配的原始字符;若不合法,则继续将该第一个与所述查询字符匹配的原始字符替换为所述替换字符中的第二个字符,然后使用该预设的语义模型判断包含该替换字符中的第二个字符的句子是否合法,若合法,则将该替换字符中的第个个字符作为目标替换字符,用于替换该文本信息中的第一个与所述查询字符匹配的原始字符;若仍不合法,则重复上述步骤直到找到所述目标替换字符。
在本实施例中,该语义模型为n-gram模型,该n-gram模型是一个通过计算极大似然估计(Maximum Likelihood Estimate)构造语言模型,它也是一个可以用来计算一个句子合法概率的模型。在使用该模型判断句子是否合法时,具体通过该模型计算出句子合法性的概率,然后将计算的得到的概率与一个阈值进行比较,若该计算得到的概率大于该阈值,则判定该句子合法,该计算得到的概率小于该阈值,则判定该句子不合法,其中,该阈值可以通过训练得到。需要说明的是,本实施例中的句子合法,指的是句子的语法及语义合理,且句子表达的意思清楚无误。
在对第一个原有字符完成替换之后,会继续以所述查询字符为查询条件,从获取第一个原有字符的位置开始继续在文本信息中进行遍历查询以找到第二个与所述查询字符匹配的字符,在找到该第二个与所述查询字符匹配的字符时,将该第二个与所述查询字符匹配的原有字符替换为所述替换字符中的字符,以此类推,直到完成所有字符的替换为止,具体的字符替换方法在上文已详细描述,在此不再赘述。在另一实施方式中,可以先在文本信息中查找到与所述查询字符相同个数的匹配字符之后,再根据各个查找到的匹配字符在所述文本信息中的位置将该匹配字符替换为所述替换字符中的各个字符,当然,也可以采取并行的方式进行字符替换,即可以一次替换多个字符或者一次性替换所有的字符。
进一步地,在一实施方式中,所述替换模块503,还用于当存在与所述查询字符匹配的字符时,判断查找到的字符的个数是否与所述查询字符的个数相同;及用于当查找到的字符的个数与所述查询字符的个数相同时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
具体地,在文本信息中查找与所述查询字符相匹配的字符时,当查找到匹配的字符时,需要记录当前查找到的字符是第几个匹配的字符,以便确定当前查找到的匹配字符的个数 是否已足够,即判断查找到的字符的个数是否与所述查询字符的个数相同。
当在文本信息中查找到与所述查询字符的个数一样多的匹配字符时,即可按照查找到的字符在所述文本信息中的位置,将查找到的各个字符一一对应替换为所述替换字符中的各个字符。在本实施例中,所述位置为所述查找到的字符在所述文本信息中的先后顺序。
举例如下:假设所述文本信息由如下字符组成:“absdefcdabcejgalv”,所述查询字符为“aa”,所述替换字符为“zm”,在对该文本信息进行遍历查询之后,可以得到查找到的第一个匹配的字符“a”位于该文本信息中的第一位,查找到的第二个匹配的字符“a”位于该文本信息中的第九位,则在对查找到的字符进行替换时,先将位于该文本信息中的第一位中的字符“a”替换为字符“z”,然后判断替换后的句子是否合法,若合法,则将该字符“z”作为目标替换字符,若不合法,则将第一位中的字符“a”替换为字符“m”,然后判断替换后的句子是否合法,若合法,则将该字符“m”作为目标替换字符。同理,在将位于该文本信息中的第九位中的字符“a”进行替换时,仍重复上述替换步骤,假设经替换后,该文本信息变为“z bsdefcd m bcejgalv”。
进一步地,在一实施方式中,当遍历完所述文本信息时,发现查找到的匹配字符的个数少于所述查询字符的个数时,可以输出提示消息,以提醒用户在文本信息中不存在这么多个数的匹配字符。优选地,该提示消息可以以弹窗的方式提示“匹配字符的个数不足”或“请减少查询字符的个数”等。
进一步地,在另一实施方式中,当遍历完所述文本信息时,发现发现查找到的匹配字符的个数少于所述查询字符的个数时,仍然可以按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
举例如下:假设所述文本信息由如下字符组成:“abcdefah”,所述查询字符为“aaa”,所述替换字符为“zmg”,在对该文本信息进行遍历查询之后,可以得到查找到的第一个匹配的字符“a”位于该文本信息中的第一位,查找到的第二个匹配的字符“a”位于该文本信息中的第七位,未查找到第三个匹配的字符,则在对查找到的字符进行替换时,先将位于该文本信息中的第一位中的字符“a”替换为字符“z”,然后判断替换后的句子是否合法,若合法,则将该字符“z”作为目标替换字符,若不合法,则将第一位中的字符“a”替换为字符“m”,然后判断替换后的句子是否合法,若合法,则将该字符“m”作为目标替换字符,若仍不合法,将第一位中的字符“a”替换为字符“g”,然后判断替换后的句子是否合法,若合法,则将该字符“g”作为目标替换字符。同理,在将位于该文本信息中的第七位中的字符“a”进行替换时,仍重复上述替换步骤,假设经替换后,该文本信息变为“zbcdefmh”。
更进一步地,在一实施方式中,所述查找模块502,还用于以所述查询字符为查询条件,根据所述位置信息在所述文本信息中查找是否存在与所述查询字符相匹配的字符。
具体地,所述查询字符还包括待替换字符的位置信息,所述待替换字符为文本信息中需要使用新的字符(即本申请中的替换字符)将该待替换字符进行替换的字符。所述位置信息为所述待替换字符在所述文本信息中的位置。在一具体实施方式中,所述查询字符中的位置信息以如下方式表示:所述查询字符为“a1,a4”,该查询字符代表的意思为,需要将文本信息中的第一个字符“a”,及第4个字符“a”,替换为新字符。
在以查询字符为查询条件时,通过在文本信息中进行遍历查找,在查找到与该查询字符相匹配的字符时,进一步需要根据该位置信息来判定该查找到的字符是否属于与所述查询字符相匹配的字符。
举例如下:假设所述文本信息为“abcdaeaf”,所述查询字符为“a1,a4”,当在文本信息中进行遍历查找时,查找到第一个字符“a”时,发现该字符“a”的位置信息与查询字符的位置信息相同,故可将该第一个字符“a”作为与所述查询字符相匹配的字符,继续查找时,查找到第二个字符“a”时,发现该字符“a”的位置信息与查询字符的位置信息不相同,不将该第二个字符“a”作为与所述查询字符相匹配的字符。
在本申请另一实施方式中,所述替换系统500还包括:
提供模块,用于提供一输入界面,以供用户输入所述查询字符与所述替换字符。
具体地,在需要对文本信息中的多个原有字符进行替换之前,可以通过当前所操作的编辑工具向用户提供一输入界面,用户通过该输入界面,可以输入所述查询字符与所述替换字符。
本申请本实施例所提出的字符替换系统,通过获取用户输入的查询字符以及替换字符,其中,所述查询字符包括至少两个相同的字符,所述替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的字符;以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及当存在与所述查询字符匹配的字符时,将与所述查询字符匹配的字符替换为所述替换字符,从而能够实现将多个相同的原有字符同时替换为不同的新字符,无需对每一个原有字符都重新进行输入、查找及替换的操作,从而减小字符替换的繁琐程度。
参阅图6,是本申请实施例之计算机设备600的硬件架构示意图。在本实施例中,所述计算机设备600是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。如图所示,所述计算机设备600至少包括,但不限于,可通过系统总线相互通信连接存储器601、处理器602、网络接口603、以及字符替换系统604。其中:
本实施例中,存储器601至少包括一种类型的非易失性计算机可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器601可以是计算机设备600的内部存储单元,例如该计算机设备600的硬盘或内存。在另一些实施例中,存储器601也可以是计算机设备600的外部存储设备,例如该计算机设备600上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器601还可以既包括计算机设备600的内部存储单元也包括其外部存储设备。本实施例中,存储器601通常用于存储安装于计算机设备600的操作系统和各类应用软件,例如字符替换系统604的程序代码等。此外,存储器601还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器602在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器602通常用于控制计算机设备600的总体操作。本实施例中,处理器602用于运行存储器601中存储的程序代码或者处理数据,例如运行字符替换系统604,以实现上述各个实施例中的字符替换方法。
所述网络接口603可包括无线网络接口或有线网络接口,该网络接口603通常用于在所述计算机设备600与其他电子装置之间建立通信连接。例如,所述网络接口603用于通过网络将所述计算机设备600与外部终端相连,在所述计算机设备600与外部终端之间的建立数据传输通道和通信连接等。所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi等无线或有线网络。
需要指出的是,图6仅示出了具有部件601-604的计算机设备600,但是应理解的是,并不要求实施所有示出的部件,可以替代的实施更多或者更少的部件。
在本实施例中,存储于存储器601中的所述字符替换系统604还可以被分割为一个或者多个程序模块,所述一个或者多个程序模块被存储于存储器601中,并由一个或多个处理器(本实施例为处理器602)所执行,以完成本申请之字符替换方法。
本实施例还提供一种非易失性计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机可读指令,程 序被处理器执行时实现相应功能。本实施例的非易失性计算机可读存储介质用于存储字符替换系统500或604,以被处理器执行时实现以下步骤:
获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种字符替换方法,包括以下步骤:
    获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
    以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
    当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
    依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
    使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
    若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
  2. 如权利要求1所述的字符替换方法,所述当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符的步骤包括:
    当存在与所述查询字符匹配的字符时,判断查找到的字符的个数是否与所述查询字符的个数相同;及
    若查找到的字符的个数与所述查询字符的个数相同,则按照查找到的字符在所述文本信息中的位置将所述查找到的字符对应替换为所述替换字符。
  3. 如权利要求2所述的字符替换方法,所述判断查找到的字符的个数是否与所述查询字符的个数相同的步骤之后,还包括:
    当查找到的字符的个数少于所述查询字符的个数时,输出提示信息。
  4. 如权利要求2所述的字符替换方法,所述判断查找到的字符的个数是否与所述查询字符的个数相同的步骤之后,还包括:
    当查找到的字符的个数少于所述查询字符的个数时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
  5. 如权利要求1所述的字符替换方法,在所述文本信息中查找与所述查询字符相匹配 的字符时,若在所述文本信息中查找到与所述查询字符个数相同的匹配字符,则执行所述按照查找到的字符在所述文本信息中的位置,将所述查找到的字符替换为所述替换字符的步骤。
  6. 如权利要求1所述的字符替换方法,所述查询字符还包括待替换字符的位置信息,所述以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符的步骤包括:
    以所述查询字符为查询条件,根据所述位置信息在所述文本信息中查找是否存在与所述查询字符相匹配的字符。
  7. 如权利要求1所述的字符替换方法,所述字符替换方法还包括:
    提供一输入界面,以供用户输入所述查询字符与所述替换字符。
  8. 一种字符替换系统,包括:
    获取模块,用于获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符的个数与所述查询字符的个数相同,且所述替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
    查找模块,用于以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
    替换模块,用于当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
    依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
    使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
    若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
  9. 如权利要求8所述的字符替换系统,所述替换模块,还用于当存在与所述查询字符匹配的字符时,判断查找到的字符的个数是否与所述查询字符的个数相同;及用于若查找到的字符的个数与所述查询字符的个数相同,则按照查找到的字符在所述文本信息中的位置将所述查找到的字符对应替换为所述替换字符。
  10. 如权利要求9所述的字符替换系统,所述替换模块,还用于当查找到的字符的个数少于所述查询字符的个数时,输出提示信息。
  11. 如权利要求9所述的字符替换系统,所述替换模块,还用于当查找到的字符的个 数少于所述查询字符的个数时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
  12. 如权利要求8所述的字符替换系统,所述查询字符还包括待替换字符的位置信息,所述查找模块,还用于以所述查询字符为查询条件,根据所述位置信息在所述文本信息中查找是否存在与所述查询字符相匹配的字符。
  13. 如权利要求8所述的字符替换系统,所述字符替换系统还包括:
    提供模块,用于提供一输入界面,以供用户输入所述查询字符与所述替换字符。
  14. 一种计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
    获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
    以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
    当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
    依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
    使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
    若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
  15. 如权利要求14所述的计算机设备,所述处理器执行所述计算机可读指令时还实现以下步骤:
    当存在与所述查询字符匹配的字符时,判断查找到的字符的个数是否与所述查询字符的个数相同;及
    若查找到的字符的个数与所述查询字符的个数相同,则按照查找到的字符在所述文本信息中的位置将所述查找到的字符对应替换为所述替换字符。
  16. 如权利要求15所述的计算机设备,所述处理器执行所述计算机可读指令时还实现以下步骤:
    当查找到的字符的个数少于所述查询字符的个数时,输出提示信息。
  17. 如权利要求15所述的计算机设备,所述处理器执行所述计算机可读指令时还实现以下步骤:当查找到的字符的个数少于所述查询字符的个数时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符。
  18. 如权利要求14所述的计算机设备,所述查询字符还包括待替换字符的位置信息,所述处理器执行所述计算机可读指令时还实现以下步骤:
    以所述查询字符为查询条件,根据所述位置信息在所述文本信息中查找是否存在与所述查询字符相匹配的字符。
  19. 如权利要求14所述的计算机设备,所述处理器执行所述计算机可读指令时还实现以下步骤:
    提供一输入界面,以供用户输入所述查询字符与所述替换字符。
  20. 一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质内存储有计算机可读指令,所述计算机可读指令可被至少一个处理器所执行,以使所述至少一个处理器执行以下步骤:
    获取用户输入的N个查询字符以及N个替换字符,其中,所述N个查询字符包括至少两个相同的查询字符,所述N个替换字符中包括至少两个不相同的替换字符,N为大于或者等于2的自然数;
    以所述查询字符为查询条件在文本信息中查找是否存在与所述查询字符相匹配的字符;及
    当存在与所述查询字符匹配的字符时,按照查找到的字符在所述文本信息中的位置,将所述查找到的字符对应替换为所述替换字符,其中,将查找到的字符对应替换为所述替换字符具体为:
    依次获取所述替换字符中的其中一个替换字符,并将所述查找到的字符替换为获取到的替换字符;
    使用预设的语义模型判断包含所述获取到的所述替换字符的句子是否合法;
    若合法,则将所述获取到的所述替换字符作为目标替换字符,以替换所述查找到的字符。
PCT/CN2019/117404 2019-06-25 2019-11-12 字符替换方法、系统、计算机设备及计算机可读存储介质 Ceased WO2020258652A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910553284.XA CN110442843B (zh) 2019-06-25 2019-06-25 字符替换方法、系统、计算机设备及计算机可读存储介质
CN201910553284.X 2019-06-25

Publications (1)

Publication Number Publication Date
WO2020258652A1 true WO2020258652A1 (zh) 2020-12-30

Family

ID=68428306

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117404 Ceased WO2020258652A1 (zh) 2019-06-25 2019-11-12 字符替换方法、系统、计算机设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN110442843B (zh)
WO (1) WO2020258652A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363655A (zh) * 2020-11-30 2021-02-12 中国银行股份有限公司 一种数据处理方法及装置
CN113434641B (zh) * 2021-07-26 2022-10-11 广州四三九九信息科技有限公司 一种多线程屏蔽字查询替换方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6631501B1 (en) * 1999-06-30 2003-10-07 Microsoft Corporation Method and system for automatic type and replace of characters in a sequence of characters
CN103678554A (zh) * 2013-12-06 2014-03-26 金蝶软件(中国)有限公司 字符替换的方法和装置
CN105608064A (zh) * 2015-11-24 2016-05-25 小米科技有限责任公司 字符替换方法及装置
CN109241504A (zh) * 2018-09-03 2019-01-18 合肥智慧龙图腾知识产权股份有限公司 一种字符串替换方法、装置、计算机设备及计算机可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100504878C (zh) * 2007-05-24 2009-06-24 中兴通讯股份有限公司 预处理特殊字符的sql语句构造方法和装置
JP6605995B2 (ja) * 2016-03-16 2019-11-13 株式会社東芝 音声認識誤り修正装置、方法及びプログラム
CN106502979A (zh) * 2016-09-20 2017-03-15 海信集团有限公司 一种自然语言信息的数据处理方法和装置
CN106650715B (zh) * 2016-10-26 2019-07-12 西安电子科技大学 一种根据允许集对字符串ocr识别结果检错与纠错的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6631501B1 (en) * 1999-06-30 2003-10-07 Microsoft Corporation Method and system for automatic type and replace of characters in a sequence of characters
CN103678554A (zh) * 2013-12-06 2014-03-26 金蝶软件(中国)有限公司 字符替换的方法和装置
CN105608064A (zh) * 2015-11-24 2016-05-25 小米科技有限责任公司 字符替换方法及装置
CN109241504A (zh) * 2018-09-03 2019-01-18 合肥智慧龙图腾知识产权股份有限公司 一种字符串替换方法、装置、计算机设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN110442843B (zh) 2024-06-11
CN110442843A (zh) 2019-11-12

Similar Documents

Publication Publication Date Title
CN110415679B (zh) 语音纠错方法、装置、设备和存储介质
WO2021151270A1 (zh) 图像结构化数据提取方法、装置、设备及存储介质
WO2021003819A1 (zh) 基于知识图谱的人机对话方法及人机对话装置
CN111368918B (zh) 文本纠错方法、装置、电子设备及存储介质
WO2021051517A1 (zh) 基于卷积神经网络的信息检索方法、及其相关设备
WO2020155740A1 (zh) 信息查询方法、装置、计算机设备及存储介质
US8965909B2 (en) Type-ahead search optimization
CN105976818A (zh) 指令识别的处理方法及装置
WO2021042542A1 (zh) 目录存储方法、装置、计算机设备及存储介质
CN109871251B (zh) 一种响应数据的处理方法、装置、存储介质及终端设备
WO2018205704A1 (zh) 电子装置、智能语音导航方法及计算机可读存储介质
US11630825B2 (en) Method and system for enhanced search term suggestion
CN108959247A (zh) 一种数据处理方法、服务器及计算机可读介质
CN110929514B (zh) 文本校对方法、装置、计算机可读存储介质及电子设备
CN107832035B (zh) 一种智能终端的语音输入方法
CN113177407A (zh) 数据字典的构建方法、装置、计算机设备及存储介质
CN114911984A (zh) 搜索数据处理方法、装置及计算机存储介质
WO2018076971A1 (zh) 一种xml数据的操作方法及设备
CN109783589B (zh) 电子地图解析地址的方法、装置及存储介质
WO2019042322A1 (zh) 一种翻译数据的管理方法、存储介质及电子设备
WO2020258652A1 (zh) 字符替换方法、系统、计算机设备及计算机可读存储介质
CN112765963B (zh) 语句分词方法、装置、计算机设备及存储介质
CN112417875A (zh) 配置信息的更新方法、装置、计算机设备及介质
CN114282092B (zh) 信息处理方法、装置、设备及计算机可读存储介质
CN110795617A (zh) 一种搜索词的纠错方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19935669

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19935669

Country of ref document: EP

Kind code of ref document: A1