CN108089900A - A kind of character string processing method and device - Google Patents
A kind of character string processing method and device Download PDFInfo
- Publication number
- CN108089900A CN108089900A CN201711295913.0A CN201711295913A CN108089900A CN 108089900 A CN108089900 A CN 108089900A CN 201711295913 A CN201711295913 A CN 201711295913A CN 108089900 A CN108089900 A CN 108089900A
- Authority
- CN
- China
- Prior art keywords
- language
- string
- resource
- character
- string resource
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
- Document Processing Apparatus (AREA)
Abstract
This application discloses a kind of character string processing method and devices.This method includes:Obtain string resource mark;In N number of language being set using in the character resource of highest priority language, it searches the string resource and identifies corresponding string resource content, if not finding, the string resource is obtained according to the character resource of system default language and identifies corresponding first string resource content;The value of the unicode codes of character in the first string resource content is judged whether in the unicode code value ranges of the highest priority language character, if so, output the first string resource content;Otherwise, obtain has the language of same alike result with the highest priority language in N number of language being set using, the string resource is obtained according to the character resource of the language with same alike result and identifies corresponding second string resource content, and exports the second string resource content.The application can improve the reasonability of string processing.
Description
Technical field
This application involves microcomputer data processing field more particularly to a kind of character string processing methods and device.
Background technology
In order to meet the user's needs for using different language, application program is generally required to support multilingual, calculated therefore
It presets multilingual in machine equipment to select to use for user, and a kind of language therein is arranged to system default language.
It presets and system resource catalogue is provided in the computer equipment of multilingual, different language is in the system resource mesh
There are corresponding subdirectory in record, there is also independent subdirectory, a kind of language pair in the Resource TOC for system default language
The character resource file of the language can be stored under the subdirectory answered.A kind of character resource file of language is used for using the language
The string resource content of speech is defined.For example, having defined in Chinese character resource file, " character string A=tests word
Symbol " represents the string resource that ID is " character string A ", and wherein text character string resource content is " test character ", if user circle
It needs to show character string A in face and user selects to use Chinese, then character string A is shown as " test word in the user interface
Symbol ";Have defined in English character resource file " character string A=test string ", represent the character that ID is " character string A "
String resource, English character string resource content are " test string ", if needing to show character string A and use in user interface
Family selection is using English, then character string A is shown as " test string " in the user interface.
User can select to show user interface using multilingual, and can set the preferential of the multilingual
Grade.For example, user can be selected using Chinese and English, and the priority of Chinese is set higher than the priority of English.
With user's selection using first language and second language, and the priority of first language is excellent higher than second language
Exemplified by first grade, at present, the looked-up sequence for some character string (such as character string A) resource content is:First in first language
Character resource file in search the resource content of character string A, if character string A has in the character resource file of first language
It defines, then string resource content corresponding in the character resource file output string A, otherwise in the word of second language
The resource content that character string A is searched in resource file is accorded with, is determined if character string A has in the character resource file of second language
Justice, then string resource content corresponding in the resource file output string A, otherwise from the character of system default language
The string resource content corresponding to character string A is searched in resource file, and exports the string resource content found.
The above-mentioned prior art there are string processing it is unreasonable the problem of.For example, there are one characters for certain application program
Resource identification is character string A (being represented below with stringA), and the language which supports is included in simplified form of Chinese Character, traditional font
Text and English.Definition of the stringA in the character resource file of system default language be:StringA=tests character, in letter
It is not defined in the character resource file of body Chinese, the definition in the character resource file of Chinese-traditional is:StringA=Measuring
Try characters.If the language being set using is according to the order of priority from high to low:Simplified form of Chinese Character, English, Chinese-traditional, then
According to above-mentioned flow, stringA is finally outputted as test string.But support simplified form of Chinese Character, selection in application program
In the case that the language used includes simplified form of Chinese Character and highest priority, and system default language is also simplified form of Chinese Character, most
What is exported eventually is English, it is clear that unreasonable.
The content of the invention
The embodiment of the present application provides a kind of character and passes processing method and processing device, to improve the reasonability of string processing.
In a first aspect, a kind of character string processing method is provided, including:
Obtain string resource mark;
In N number of language being set using in the character resource of highest priority language, the string resource mark is searched
Know corresponding string resource content, if not finding, the character string is obtained according to the character resource of system default language
The corresponding first string resource content of resource identification, N are the integer more than 1;
Judge the value of the unicode codes of character in the first string resource content whether in the highest priority
In the unicode code value ranges of language character, if so, output the first string resource content;Otherwise, described in acquisition
In N number of language being set using with the highest priority language there is the language of same alike result, there is same genus according to described
Property the character resource of language obtain the string resource and identify corresponding second string resource content, and export described the
Two string resource contents.
Optionally, if exist in N number of language being set using has same alike result with the highest priority language
Multiple language, then the character resource of the language with same alike result described in the basis obtain string resource mark pair
The the second string resource content answered, including:The character resource of highest priority language in the multiple language, obtains
The string resource identifies corresponding second string resource content.
Optionally, if be not present in N number of language being set using has same genus with the highest priority language
The language of property, then the method further include:
According to the order of priority from high to low, in the character resource for the language that N-1 are set using, the word is searched
The corresponding 3rd string resource content of symbol string resource identification, exports the 3rd string resource content.Wherein, the N-1
A language being set using is the language that highest priority is removed in N number of language being set using.
Optionally, if order according to priority from high to low, the character money for the language not being set using at the N-1
The string resource is found in source and identifies corresponding 3rd string resource content, then the method further includes:According to being
It unites the character resource of default language, obtains the string resource and identify corresponding 4th string resource content, described in output
4th string resource content.
Optionally, it is described to be with the highest priority language has same alike result language:With the highest priority
Language belongs to the language in same country or area.
Second aspect provides a kind of character string processing apparatus, including:Acquisition module, processing module and output module;
The acquisition module, for obtaining string resource mark;
The processing module, in the character resource of highest priority language in N number of language being set using, searching
The string resource identifies corresponding string resource content, if not finding, is provided according to the character of system default language
Source obtains the string resource and identifies corresponding first string resource content, and N is the integer more than 1;And
Judge the value of the unicode codes of character in the first string resource content whether in the highest priority
In the unicode code value ranges of language character, if so, being exported by the output module in first string resource
Hold;Otherwise, obtain has the language of same alike result, root with the highest priority language in N number of language being set using
The string resource, which is obtained, according to the character resource of the language with same alike result identifies corresponding second string resource
Content, and the second string resource content is exported by the output module;
The output module, for exporting the string resource content that the processing module obtains.
Optionally, the processing module is additionally operable to:
If the language that there is same alike result with the highest priority language is not present in N number of language being set using
Speech, then the order according to priority from high to low, in the character resource for the language that N-1 are set using, searches the character
The corresponding 3rd string resource content of string resource identification;Wherein, the N-1 language being set using are N number of setting
The language of highest priority is removed in the language used;And
The 3rd string resource content is exported by the output module.
Optionally, the processing module is additionally operable to:If according to the order of priority from high to low, do not set at the N-1
It puts and the corresponding 3rd string resource content of the string resource mark is found in the character resource of the language used, then root
The string resource is obtained according to the character resource of system default language and identifies corresponding 4th string resource content, and is passed through
The output module exports the 4th string resource content.
The third aspect provides a kind of computer equipment, including:One or more processors;And one or more storages
Device is stored with instruction on the memory, when described instruction is performed by one or more of processors so that the computer
Equipment performs the method any one of above-mentioned first aspect.
Fourth aspect provides one or more computer-readable mediums, and instruction, the finger are stored on the readable medium
When order is executed by one or more processors so that computer equipment performs the method any one of above-mentioned first aspect.
5th aspect, provides a kind of computer program product, and for storing computer program, which is used to hold
Method any one of the above-mentioned first aspect of row.
In above-described embodiment of the application, when the character resource of the highest priority language in N number of language being set using
In, string resource is not found and identifies corresponding string resource content, is obtained according to the character resource of system default language
The string resource identifies corresponding first string resource content, and determines whether the first string resource content
The value of the unicode codes of middle character whether in the unicode code value ranges of the highest priority language character, if
It is then to export the first string resource content;Otherwise, obtain excellent with the highest in N number of language being set using
First grade language has the language of same alike result, and the character string is obtained according to the character resource of the language with same alike result
The corresponding second string resource content of resource identification, and export the second string resource content.As can be seen that the application
Embodiment can identify corresponding character when not finding string resource in the character resource of the language of highest priority
In the case of string resource content, preferentially according to the character resource of system default language or the character of the language with same alike result
Resource carries out string processing, so as to improve the reasonability of string processing.
Description of the drawings
Fig. 1 is a kind of string processing flow diagram provided by the embodiments of the present application;
Fig. 2 is the string processing flow diagram that another embodiment of the application provides;
Fig. 3 is the structure diagram of character string processing apparatus provided by the embodiments of the present application;
Fig. 4 is the structure diagram of computer equipment provided by the embodiments of the present application.
Specific embodiment
Following technical term is used in the embodiment of the present application, first below to some skills involved in the embodiment of the present application
Art term illustrates.
String resource identifies (ID):For identification strings resource.
Character resource:Usually exist with document form, such as extensible markup language (eXtensible Markup
Language, XML) file.By taking XML file as an example, a kind of language corresponds to an XML file, has character defined in the XML file
The string resource content gone here and there corresponding to resource identification.Same string resource mark is different in different XML files
Definition.It is " test character " defined in the corresponding XML file of Chinese, in English for example, being identified as the string resource of A
It is defined in corresponding XML file " test string ".
The embodiment of the present application can be applied to system application or third party application, and the application program can be base
In the application program of android system.
The embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
It is a kind of string processing flow diagram provided by the embodiments of the present application referring to Fig. 1.The flow can be by character string
Processing unit is realized.The character string processing apparatus can be the device in computer equipment or computer equipment.The calculating
Machine equipment can be any equipment with data-handling capacity, for example can be terminal, can specifically include:Smart mobile phone,
Tablet computer, laptop, personal digital assistant (Personal Digital Assistant, PDA), intelligent wearable device
Or the similar devices such as car-mounted terminal.
As shown in the figure, it can include to flow:
S101:Obtain string resource mark.
In a kind of possible scene, application program needs to show character string in the user interface during running, this
When, string resource mark is obtained first.Wherein, the application program can be system application or third party
Application program.
S102:In the language being set using N number of (N is the integer more than 1) in the character resource of highest priority language,
It searches the string resource and identifies corresponding string resource content, if not finding, be transferred to S103, turn if finding
Enter S106.
Wherein, N number of language being set using can be user's language selected to use.User can be carried by system
For language interface is set to select using one or more language, if selection multilingual, can also set these language
Priority, according to the order of priority from high to low, can be described as:First language, second language, the 3rd language, and so on.
If the language that the language of user's selection is supported with application program mismatches, N number of language being set using can be used
The intersection for the language that the language of family selection is supported with application program.
S103:According to the character resource of system default language, obtain the string resource and identify corresponding first character
String resource content.
S104:Judge whether the value of the unicode codes of character in the first string resource content is preferential in the highest
In the unicode code value ranges of grade language character, if so, being transferred to S106, S105 is otherwise transferred to.
Wherein, a kind of value range of the unicade codes of all characters in language typically comprises a continuous value model
It encloses, the unicade codes of the character of language not of the same race have different value ranges.For example, the value of the unicade codes of Chinese character
Scope (using hexadecimal representation) is 4E00~9FBB.
S105:Obtain has the language of same alike result with the highest priority language in N number of language being set using
Speech according to the character resource of the language with same alike result, obtains the string resource and identifies corresponding second character
String resource content.
Optionally, the language with the highest priority language with same alike result, can be excellent with the highest
First grade language belongs to the language in same country or area.If for example, the highest priority language is Simplified Chinese, in
The simplified language with same alike result of text includes Traditional Chinese.
Optionally, if exist in N number of language being set using has same alike result with the highest priority language
Multiple language, then can the character string be obtained according to the character resource of the highest priority language in the multiple language
The corresponding second string resource content of resource identification.
S106:The string resource content that output current lookup arrives.
Optionally, output string resource content can specifically include:String resource content is included in display device
On string resource content either exported into the other equipment or otherwise export, the embodiment of the present application does not do this
Limitation.
Further, in the S105 of above-mentioned flow, if being not present in N number of language being set using excellent with the highest
First grade language has the language of same alike result, then can be according to the order of priority from high to low, except above-mentioned highest priority
In the character resource of the N-1 language being set using of language, search the string resource and identify corresponding 3rd character string
Resource content.
Optionally, if order according to priority from high to low, the character money for the language not being set using at the N-1
The string resource is found in source and identifies corresponding 3rd string resource content, then it can be according to system default language
Character resource obtains the string resource and identifies corresponding 4th string resource content.
As can be seen that the embodiment of the present application can be worked as does not find character in the character resource of the language of highest priority
It goes here and there in the case of the corresponding string resource content of resource identification, preferentially according to the character resource of system default language or has
The character resource of the language of same alike result carries out string processing, so as to improve the reasonability of string processing, and then can be with
Improve the string resource compatibility of application program.
In order to be more clearly understood that the embodiment of the present application, with reference to a concrete application scene, to the embodiment of the present application
Specific implementation process be described in detail.
In the application scenarios, certain application program is character string A (being represented below with stringA) there are one character resource, should
The language that application program is supported includes simplified form of Chinese Character, Chinese-traditional and English.
User's language selected to use is according to the order of priority from high to low:Simplified form of Chinese Character, English, Chinese-traditional.
The structure of system resource catalogue includes:
res/values/dufalt.xml
res/values-zh-rCN/chinese1.xml
res/values-en/englishi.xml
res/values-zh-rTW/chinese2.xml
Wherein, system default language character resource file dufalt.xml is stored under values catalogues, is had in this document
The resource definition of stringA:StringA=tests character.Simplified Chinese character resource is stored under values-zh-rCN catalogues
File chinese1.xml does not have the resource definition of stringA in this document.English character is stored under values-en catalogues
Resource file englishi.xml has the resource definition of stringA in this document:StringA=test string.values-
Traditional Chinese character resource file chinese2.xml is stored under zh-rTW catalogues, the resource for having stringA in this document is determined
Justice:StringA=Measuring Try characters.
Based on above-mentioned scene, string processing flow can as shown in Fig. 2, including:
S201:The language list and the mark of pending character string stringA set in acquisition system.
Wherein, include in the language list according to the order of priority from high to low:Simplified form of Chinese Character, English, Chinese-traditional.
For convenience of description, simplified form of Chinese Character is known as first language below, English is known as second language, Chinese-traditional is known as the 3rd language
Speech.
S202:Obtain the character resource file (res/values-zh-rCN/ under the Resource TOC of first language
Chinese1.xml), the resource definition of stringA in this document is searched, if finding, S209 is transferred to, is otherwise transferred to S203.
In S209, the corresponding first language string resource contents of stringA are obtained according to the character resource file, it is defeated
Go out the string resource content.
In this example, due to not having the resource definition of stringA in chinese1.xml files, S203 is transferred to.
S203:The character resource file (res/values/dufalt.xml) of system default language is obtained, and searches this article
The resource definition of stringA in part, and it is transferred to S204.
S204:According to the resource definition of the stringA found, the corresponding character strings of stringA are obtained, judge the character
The character (whether including simplified Chinese character) of first language whether is included in string, if so, being transferred to S210, is otherwise transferred to
S205。
In S210, the corresponding string resource contents of stringA that export.
In the step, the unicade codes of simplified Chinese character whether can be fallen into according to the value of the unicade codes of character
Value range, whether to judge in string resource content comprising simplified Chinese character.
In this example, there is the resource definition of stringA in dufalt.xml files:StringA=tests character, according to
S204 can obtain string resource content " test character ", in may determine that the string resource content includes by detection
The simplified character of text, therefore it is transferred to S210.
S205:It whether there is the language for belonging to same country or area with first language in second language and the 3rd language,
If in the presence of being transferred to S211, be otherwise transferred to S206.
In S211, obtained according to the resource definition of the language of the same alike result in the corresponding string resources of stringA
Hold, export the string resource content.
Wherein, Chinese-traditional (the 3rd language) and simplified form of Chinese Character (first language) are same country or regional language.
S206:Obtain the character resource file (res/values-en/ under the Resource TOC of second language
Englishi.xml), the resource definition of stringA in this document is searched, if finding, S212 is transferred to, is otherwise transferred to S207.
In S212, the string resource content of the corresponding second languages of stringA exported.
S207:Obtain the character resource file (res/values-zh-rTW/ under the Resource TOC of the 3rd language
Chinese2.xml), the resource definition of stringA in this document is searched, if finding, S213 is transferred to, is otherwise transferred to S208.
In S213, the corresponding 3rd language character string resource contents of the stringA found are exported, export the character string
Resource content.
S208:The character resource file (res/values/dufalt.xml) of system default language is obtained, and searches this article
The resource definition of stringA in part obtains the corresponding default language string resource contents of stringA, exports character string money
Source contents.
It can be seen that by flow shown in Fig. 2 under above-mentioned scene, the character string of final output is simplified Chinese character
It goes here and there " test character ".And in a manner that the prior art provides, then the character string of final output is English character string " test
string”.The two compares as can be seen that supporting simplified form of Chinese Character in application program, and language selected to use includes simplified form of Chinese Character
And highest priority, in the case that system default language is also simplified form of Chinese Character, final output be simplified Chinese character string without
It is English character string, it is clear that more reasonable using the obtained result of above-described embodiment of the application.
It is understood that the embodiment of the present application, in order to realize above-mentioned function, it comprises performing, each function is corresponding
Hardware configuration and/or software module.Each exemplary unit (device, device) for being described with reference to embodiment disclosed herein and
Algorithm steps, the embodiment of the present application can be realized with the combining form of hardware or hardware and computer software.Some function is studied carefully
Unexpectedly performed in a manner of hardware or computer software driving hardware, specific application and design constraint depending on technical solution
Condition.Those skilled in the art can realize described function to each specific application using different methods, but
It is this realization it is not considered that the scope of the technical solution beyond the embodiment of the present application.
The embodiment of the present application can according to above method example to perform the above method device carry out functional unit (device,
Device) division, can also be by two or two for example, can correspond to each function divides each functional unit (device, device)
Above function is integrated in a processing unit (device, device).Hardware both may be employed in above-mentioned integrated unit (device, device)
Form realize, can also be realized in the form of SFU software functional unit (device, device).It should be noted that the application is implemented
It is schematical to the division of unit (device, device) in example, is only a kind of division of logic function, can have in actual implementation in addition
Dividing mode.
In the case of using integrated unit (device, device), Fig. 3 shows a kind of character provided by the embodiments of the present application
The structure diagram of string manipulation device.As shown in fig.3, character string processing apparatus 300 includes:Acquisition module 301, processing module
302nd, output module 303.
Acquisition module 301 identifies for obtaining string resource;Processing module 302 is used in N number of language being set using
In the character resource of middle highest priority language, search the string resource and identify corresponding string resource content, if not
It finds, then obtaining the string resource according to the character resource of system default language identifies corresponding first string resource
Content, N are the integer more than 1;And judge that the values of the unicode codes of character in the first string resource content is
It is no in the unicode code value ranges of the highest priority language character, if so, pass through output module 303 export institute
State the first string resource content;Otherwise, obtain has in N number of language being set using with the highest priority language
The language of same alike result obtains the string resource mark according to the character resource of the language with same alike result and corresponds to
The second string resource content, and pass through output module 303 and export the second string resource content.Output module 303
For output string resource content.
Optionally, processing module 302 is additionally operable to:If it is not present in N number of language being set using excellent with the highest
First grade language has the language of same alike result, then the order according to priority from high to low, in the language that N-1 are set using
In character resource, search the string resource and identify corresponding string resource content;Wherein, the N-1 are set using
Language to remove the language of highest priority in N number of language being set using;And institute is exported by output module 303
State the 3rd string resource content.
Optionally, processing module 302 is additionally operable to:If according to the order of priority from high to low, not in described N-1 setting
The string resource is found in the character resource of the language used and identifies corresponding string resource, then according to system default
The character resource of language obtains the string resource and identifies corresponding 4th string resource content, and passes through output module
303 output the 4th string resource contents.
Fig. 4 shows the structure diagram of computer equipment 400 provided by the embodiments of the present application, that is, shows at character string
Manage another structure diagram of device 300.As shown in fig.4, computer equipment 400 includes processor 401, network interface 402.
Wherein, processor 401 or controller.The processor 401 is configured as supporting 300 execution figure of character string processing apparatus
Function involved in 1 or Fig. 2.Network interface 402 is configured as supporting the function of 300 messaging of character string processing apparatus.Meter
Memory 403 can also be included by calculating machine equipment 400, and memory 403 preserves equipment necessity for being coupled with processor 401
Program instruction and data.Wherein, processor 401, network interface 402 are connected with memory 403, which is used to deposit
Storage instruction, which is used to perform the instruction of the memory 403 storage, complete to control 402 messaging of network interface
Character string processing apparatus 300 performs the step of corresponding function into the above method.
In the embodiment of the present application, implement involved by character string processing apparatus 300 and computer equipment 400 with the application
The relevant concept of technical solution that example provides is explained and is described in detail and other steps refer to preceding method or other embodiment
In the description as described in these contents, be not repeated herein.
It should be noted that the above-mentioned processor being related to of the embodiment of the present application can be central processing unit (central
Processing unit, CPU), general processor, digital signal processor (digital signal processor, DSP),
Application-specific integrated circuit (application-specific integrated circuit, ASIC), field programmable gate array
It is (field programmable gate array, FPGA) or other programmable logic device, transistor logic, hard
Part component or its any combination.It can realize or perform and various illustratively patrol with reference to present disclosure is described
Collect box, module and circuit.Processor can also be the combination for realizing computing function, such as include one or more microprocessors
Combination, combination of DSP and microprocessor etc..Wherein, the memory can be integrated in the processor, can also be with institute
Processor is stated to be provided separately.
The embodiment of the present application also provides a kind of computer storage media, and for storing some instructions, these instructions are performed
When, any one method involved by foregoing character string processing apparatus can be completed.
The embodiment of the present application also provides a kind of computer program product, for storing computer program, the computer program
For performing the character string processing method involved in above method embodiment.
It should be understood by those skilled in the art that, the embodiment of the present application can be provided as method, system or computer program production
Product.Therefore, in terms of the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software and hardware
Embodiment form.Moreover, the embodiment of the present application can be used wherein includes computer available programs generation in one or more
The meter implemented in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of code
The form of calculation machine program product.
The embodiment of the present application is with reference to the method, equipment (system) and computer program product according to the embodiment of the present application
Flowchart and/or the block diagram describe.It should be understood that it can be realized by computer program instructions in flowchart and/or the block diagram
The combination of flow and/or box in each flow and/or block and flowchart and/or the block diagram.These calculating can be provided
Machine program instruction is to the processing of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices
Device is to generate a machine so that passes through the instruction that computer or the processor of other programmable data processing devices perform and generates
It is used to implement the function specified in one flow of flow chart or multiple flows and/or one box of block diagram or multiple boxes
Device.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Claims (10)
1. a kind of character string processing method, which is characterized in that including:
Obtain string resource mark;
In N number of language being set using in the character resource of highest priority language, the string resource mark pair is searched
If not finding, the string resource is obtained according to the character resource of system default language for the string resource content answered
Corresponding first string resource content is identified, N is the integer more than 1;
Judge the value of the unicode codes of character in the first string resource content whether in the highest priority language
In the unicode code value ranges of character, if so, output the first string resource content;Otherwise, obtain described N number of
There is the language of same alike result with the highest priority language, according to described with same alike result in the language being set using
The character resource of language obtains the string resource and identifies corresponding second string resource content, and exports second word
Symbol string resource content.
2. the method as described in claim 1, which is characterized in that if in N number of language being set using exist with it is described most
High priority language has multiple language of same alike result, then the character resource of the language with same alike result described in the basis
It obtains the string resource and identifies corresponding second string resource content, including:
It is corresponding to obtain the string resource mark for the character resource of highest priority language in the multiple language
Second string resource content.
3. the method as described in claim 1, which is characterized in that if in N number of language being set using be not present with it is described
Highest priority language has the language of same alike result, then the method further includes:
According to the order of priority from high to low, in the character resource for the language that N-1 are set using, the character string is searched
The corresponding 3rd string resource content of resource identification;Wherein, the N-1 language being set using make for N number of setting
The language of highest priority is removed in language;
Export the 3rd string resource content.
4. method as claimed in claim 3, which is characterized in that if the order according to priority from high to low, not in the N-1
The string resource is found in the character resource of a language being set using and identifies corresponding 3rd string resource content,
Then the method further includes:
According to the character resource of system default language, obtain the string resource and identify in corresponding 4th string resource
Hold;
Export the 4th string resource content.
5. such as the method any one of claim 1-4, which is characterized in that described to have with the highest priority language
The language of same alike result is:Belong to the language in same country or area with the highest priority language.
6. a kind of character string processing apparatus, which is characterized in that including:Acquisition module, processing module and output module;
The acquisition module, for obtaining string resource mark;
The processing module, in the character resource of highest priority language in N number of language being set using, described in lookup
String resource identifies corresponding string resource content, if not finding, is obtained according to the character resource of system default language
Corresponding first string resource content is identified to the string resource, N is the integer more than 1;And
Judge the value of the unicode codes of character in the first string resource content whether in the highest priority language
In the unicode code value ranges of character, if so, exporting the first string resource content by the output module;
Otherwise, obtain has the language of same alike result with the highest priority language in N number of language being set using, according to institute
The character resource for stating the language with same alike result obtains the corresponding second string resource content of the string resource mark,
And the second string resource content is exported by the output module;
The output module, for exporting the string resource content that the processing module obtains.
7. device as claimed in claim 6, which is characterized in that the processing module is additionally operable to:
If the language that there is same alike result with the highest priority language is not present in N number of language being set using,
According to the order of priority from high to low, in the character resource for the language that N-1 are set using, the string resource is searched
Identify corresponding 3rd string resource content;Wherein, the N-1 is set using language are described N number of to be set using
The language of highest priority is removed in language;And
The 3rd string resource content is exported by the output module.
8. device as claimed in claim 6, which is characterized in that the processing module is additionally operable to:
If according to the order of priority from high to low, found in the character resource for the language not being set using at the N-1
The string resource identifies corresponding 3rd string resource content, then obtains institute according to the character resource of system default language
It states string resource and identifies corresponding 4th string resource content, and the 4th character string is exported by the output module
Resource content.
9. a kind of computer equipment, which is characterized in that including:Processor and memory are stored with instruction on the memory,
When described instruction is performed by the processor so that the computer equipment is performed as any one of claim 1 to 5
Method.
10. a kind of computer-readable medium, which is characterized in that instruction is stored on the readable medium, described instruction is by one
Or multiple processors are when performing so that computer performs the method as any one of claim 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711295913.0A CN108089900B (en) | 2017-12-08 | 2017-12-08 | Character string processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711295913.0A CN108089900B (en) | 2017-12-08 | 2017-12-08 | Character string processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108089900A true CN108089900A (en) | 2018-05-29 |
CN108089900B CN108089900B (en) | 2020-12-04 |
Family
ID=62174877
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711295913.0A Active CN108089900B (en) | 2017-12-08 | 2017-12-08 | Character string processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108089900B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111831866A (en) * | 2019-04-23 | 2020-10-27 | 北京猫眼文化传媒有限公司 | Mode identification method and device for input information |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5351190A (en) * | 1990-10-17 | 1994-09-27 | Canon Kabushiki Kaisha | Communication apparatus and method establishing a language dependent sort order search |
CN101140570A (en) * | 2006-09-04 | 2008-03-12 | 富士施乐株式会社 | Translating device, translating method and computer readable medium |
CN101441567A (en) * | 2008-11-18 | 2009-05-27 | 宇龙计算机通信科技(深圳)有限公司 | Method and system for supporting multiple-language user interface in mobile terminal |
CN103425509A (en) * | 2013-08-07 | 2013-12-04 | 深圳市欧珀通信软件有限公司 | Method and device for installing language package |
CN103631772A (en) * | 2012-08-29 | 2014-03-12 | 阿里巴巴集团控股有限公司 | Machine translation method and device |
-
2017
- 2017-12-08 CN CN201711295913.0A patent/CN108089900B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5351190A (en) * | 1990-10-17 | 1994-09-27 | Canon Kabushiki Kaisha | Communication apparatus and method establishing a language dependent sort order search |
CN101140570A (en) * | 2006-09-04 | 2008-03-12 | 富士施乐株式会社 | Translating device, translating method and computer readable medium |
CN101441567A (en) * | 2008-11-18 | 2009-05-27 | 宇龙计算机通信科技(深圳)有限公司 | Method and system for supporting multiple-language user interface in mobile terminal |
CN103631772A (en) * | 2012-08-29 | 2014-03-12 | 阿里巴巴集团控股有限公司 | Machine translation method and device |
CN103425509A (en) * | 2013-08-07 | 2013-12-04 | 深圳市欧珀通信软件有限公司 | Method and device for installing language package |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111831866A (en) * | 2019-04-23 | 2020-10-27 | 北京猫眼文化传媒有限公司 | Mode identification method and device for input information |
Also Published As
Publication number | Publication date |
---|---|
CN108089900B (en) | 2020-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6894058B2 (en) | Hazardous address identification methods, computer-readable storage media, and electronic devices | |
US8190613B2 (en) | System, method and program for creating index for database | |
CN105868166B (en) | Regular expression generation method and system | |
CN109448793B (en) | Method and system for labeling, searching and information labeling of right range of gene sequence | |
CN108334513A (en) | A kind of identification processing method of Similar Text, apparatus and system | |
US20150169676A1 (en) | Generating a Table of Contents for Unformatted Text | |
CN102654881B (en) | Device and method for name disambiguation clustering | |
CN107402945A (en) | Word stock generating method and device, short text detection method and device | |
CN110007906A (en) | Processing method, device and the server of script file | |
US10366142B2 (en) | Identifier based glyph search | |
CN104281275A (en) | Method and device for inputting English | |
CN105589813B (en) | A kind of electronic document version variation tracking | |
JP5780036B2 (en) | Extraction program, extraction method and extraction apparatus | |
US9002772B2 (en) | Scalable rule-based processing system with trigger rules and rule evaluator | |
CN108089900A (en) | A kind of character string processing method and device | |
CN110069604B (en) | Text search method, text search device and computer-readable storage medium | |
CN116628600A (en) | Unbalanced data sampling method and device based on random forest | |
CN110909247A (en) | Text information pushing method, electronic equipment and computer storage medium | |
JP2014130546A (en) | File management program, file management device and file management method | |
CN114880523A (en) | Character string processing method and device, electronic equipment and storage medium | |
CN103514192B (en) | Data processing method data processing equipment | |
CN105893335B (en) | The method and apparatus of display text | |
CN107408104A (en) | The statement cascade rearrangement of pattern | |
CN106598936B (en) | Letter word extraction method and device | |
CN104978273B (en) | The automatic testing method and automatic detection unit of pad name |
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 | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd. Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd. |