CN109840080B - Character attribute comparison method and device, storage medium and electronic equipment - Google Patents

Character attribute comparison method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN109840080B
CN109840080B CN201811625226.5A CN201811625226A CN109840080B CN 109840080 B CN109840080 B CN 109840080B CN 201811625226 A CN201811625226 A CN 201811625226A CN 109840080 B CN109840080 B CN 109840080B
Authority
CN
China
Prior art keywords
character
attribute
comparison value
binary
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811625226.5A
Other languages
Chinese (zh)
Other versions
CN109840080A (en
Inventor
韩志刚
宋洋
于广伟
姜楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201811625226.5A priority Critical patent/CN109840080B/en
Publication of CN109840080A publication Critical patent/CN109840080A/en
Application granted granted Critical
Publication of CN109840080B publication Critical patent/CN109840080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The disclosure relates to a character attribute comparison method, a character attribute comparison device, a storage medium and an electronic device. The method comprises the following steps: determining a first attribute comparison value according to first attribute information of a first character and second attribute information of a second character, wherein the attribute information of the characters comprises attribute values of the characters under all preset character attributes, and the first attribute comparison value is a value obtained by comparing the attribute values of the first character and the second character under all preset character attributes; and determining that the attributes of the first character and the second character are different according to the first attribute comparison value. Therefore, attribute comparison among characters can be realized, the difference of each preset character attribute among the characters can be determined by utilizing the first attribute comparison value, and the occupied memory space is small, so that even if a large number of characters needing attribute comparison exist, the memory cannot be occupied in a large amount, and the memory cost is saved.

Description

Character attribute comparison method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a character attribute comparison method and apparatus, a storage medium, and an electronic device.
Background
In some cases, the attributes of two characters need to be compared. For example, for a certain text, when the text is read, due to different reading habits of readers, attributes of certain characters in the text may be changed according to the reading habits of the readers so as to distinguish or highlight certain contents for reading, and then the original text is updated according to the changed attributes of the characters. For example, for a text containing a code for a programmer, in order to meet the habit of the programmer to read the code, the character attributes of the code part may be changed, for example, the code comment part is unified into green and italics, the constant part in the code is unified into orange, and the changed text is used as an updated text. Thus, different versions of the same text are formed, and in practical application, it is often necessary to compare whether the attributes of each pair of mutually corresponding characters of the two versions of the text are consistent. At present, texts are generally divided into small units for attribute comparison, the space occupied by comparison results is large, and when attributes of a large number of characters exist in the texts and need to be compared, the generated comparison results need to occupy a large memory space.
Disclosure of Invention
The present disclosure provides a character attribute comparison method, device, storage medium and electronic apparatus, for comparing the attribute similarity of two characters.
In order to achieve the above object, according to a first aspect of the present disclosure, there is provided a character attribute comparison method, the method including:
determining a first attribute comparison value according to first attribute information of a first character and second attribute information of a second character, wherein the attribute information of the character comprises attribute values of the character under each preset character attribute, and the first attribute comparison value is obtained by comparing the attribute values of the first character and the second character under each preset character attribute;
and determining that the attributes of the first character and the second character are different according to the first attribute comparison value.
Optionally, in a binary representation form corresponding to the first attribute comparison value, each binary bit corresponds to one of the preset character attributes, and binary values on the binary bits are used for representing that the attribute values of the first character and the second character under the preset character attributes corresponding to the binary bits are different;
the determining a first attribute comparison value according to first attribute information of the first character and second attribute information of the second character includes:
and determining the binary value of the first attribute comparison value on the binary bit corresponding to each preset character attribute in a binary representation form according to the difference and identity of the attribute value under each preset character attribute in the first character and the second character, wherein if the attribute values of the first character and the second character under a preset character attribute are the same, the binary value on the binary bit corresponding to the preset character attribute is a first value, and if the attribute values of the first character and the second character under a preset character attribute are different, the binary value on the binary bit corresponding to the preset character attribute is a second value.
Optionally, the determining, according to the first attribute comparison value, that the attributes of the first character and the second character are different includes:
if the first attribute comparison value is the same as a second attribute comparison value, determining that the attributes of the first character and the second character are the same, wherein the second attribute comparison value is an attribute comparison value corresponding to the attribute of each preset character in the first character and the second character when the attribute values of the preset character in the first character and the second character are the same;
and if the first attribute comparison value is different from the second attribute comparison value, determining that the attributes of the first character and the second character are different.
Optionally, the method further comprises:
and determining the preset character attributes with different attribute values according to the preset character attributes corresponding to each binary digit and the binary values on the binary digits of the first attribute comparison value in a binary representation form.
According to a second aspect of the present disclosure, there is provided a character attribute comparison apparatus, the apparatus including:
the first determining module is used for determining a first attribute comparison value according to first attribute information of a first character and second attribute information of a second character, wherein the attribute information of the character comprises attribute values of the character under each preset character attribute, and the first attribute comparison value is obtained by comparing the attribute values of the first character and the second character under each preset character attribute;
and the second determining module is used for determining the attribute difference of the first character and the second character according to the first attribute comparison value.
Optionally, in a binary representation form corresponding to the first attribute comparison value, each binary bit corresponds to one of the preset character attributes, and binary values on the binary bits are used for representing that the attribute values of the first character and the second character under the preset character attributes corresponding to the binary bits are different;
the first determining module is configured to determine, according to a difference and an identity of an attribute value of each preset character attribute in the first character and the second character, a binary value of the first attribute comparison value on a binary bit corresponding to each preset character attribute in a binary representation form, where if the attribute values of the first character and the second character under a preset character attribute are the same, the binary value on the binary bit corresponding to the preset character attribute is a first value, and if the attribute values of the first character and the second character under a preset character attribute are different, the binary value on the binary bit corresponding to the preset character attribute is a second value.
Optionally, the second determining module is configured to determine that the attributes of the first character and the second character are the same if the first attribute comparison value is the same as a second attribute comparison value, where the second attribute comparison value is an attribute comparison value corresponding to the attribute of each of the preset characters in the first character and the second character when the attribute values of the preset characters in the first character and the second character are the same; and if the first attribute comparison value is different from the second attribute comparison value, determining that the attributes of the first character are different from the attributes of the second character.
Optionally, the apparatus further comprises:
and the third determining module is used for determining the preset character attributes with different attribute values according to the preset character attributes corresponding to each binary digit and the binary values on the binary digits in the binary representation form of the first attribute comparison value.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect of the present disclosure.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect of the disclosure.
According to the technical scheme, a first attribute comparison value is determined according to first attribute information of a first character and second attribute information of a second character, and then the attributes of the first character and the second character are different and identical according to the first attribute comparison value, wherein the attribute information of the characters comprises the attribute values of the characters under the attributes of the preset characters, and the first attribute comparison value is obtained by comparing the attribute values of the first character and the second character under the attributes of the preset characters. Therefore, the attribute comparison between the characters can be realized, the difference of the attributes of the preset characters between the characters can be determined by utilizing the first attribute comparison value, and the memory space occupied by the first attribute comparison value is small, so that even if a large number of characters needing attribute comparison exist, the memory cannot be occupied in a large amount, and the memory cost is saved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow diagram of a character attribute comparison method provided in accordance with one embodiment of the present disclosure;
FIG. 2 is a block diagram of a character attribute comparison apparatus provided in accordance with one embodiment of the present disclosure;
FIG. 3 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of the embodiments of the disclosure refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Before introducing the method provided by the present disclosure, first, a brief introduction is made to an application scenario of the present disclosure. In some cases, it is desirable to compare the attributes of two characters, for example, for two characters of the same content, or for two characters of different content. For example, for a certain text, when reading the text, because the reading habits of readers are different, the attributes of some characters in the text may be changed according to the reading habits of the readers so as to distinguish or highlight some contents for reading, and then the original text is updated according to the changed attributes of the characters. For example, for a text containing a code for a programmer, in order to meet the habit of the programmer to read the code, the character attributes of the code part may be changed, for example, the code comment part is unified into green and italics, the constant part in the code is unified into orange, and the changed text is used as an updated text. Thus, different versions of the same text are formed, and in practical application, it is often necessary to compare whether the attributes of the two versions of the text are consistent, and the attribute difference of the text is based on the attribute difference of each character, so that it is necessary to compare the attributes of the two characters having the same content. In addition, even if the contents of two characters are different, there is a need to compare attributes.
Fig. 1 is a flowchart of a character attribute comparison method provided according to an embodiment of the present disclosure. As shown in fig. 1, the method may include the following steps.
In step 11, a first attribute comparison value is determined based on first attribute information of the first character and second attribute information of the second character.
The attribute information of the character may include attribute values of the character under each preset character attribute, and the attribute value under a certain preset character attribute of a certain character may reflect the attribute condition of the character under the preset character attribute. For example, the preset character attribute may be user-defined, for example, which character attribute of the character the user desires to pay attention to, the corresponding character attribute may be used as the preset character attribute. Wherein the preset character attributes may include, but are not limited to, any one or more of the following: the page number of the character, whether the character has a hyperlink, the page position of the character, the color corresponding to the character, the font name corresponding to the character, the font size corresponding to the character, whether the character is italic or not and whether the character is bold or not. In one possible embodiment, the attribute values under the preset character attribute may be predefined. For example, the attribute value A1 indicates that a character is italicized and the attribute value A2 indicates that a character is not italicized. For another example, the attribute value B1 indicates that the font name of the character is "song style", the attribute value B2 indicates that the font name of the character is "microsoft ja black", and the attribute value B3 indicates that the font name of the character is "regular script". As another example, the attribute value C1 indicates that a character exists a hyperlink, and the attribute value C2 indicates that a character does not exist a hyperlink. For example, the attribute value may be a predetermined constant. The first attribute information is used for representing the attribute information corresponding to the first character, and the second attribute information is used for representing the attribute information corresponding to the second character, wherein the first attribute information and the second attribute information are only used for distinguishing and do not have actual sequential significance. Alternatively, the contents of the first character and the second character may be the same.
The first attribute comparison value may be a value obtained by comparing attribute values of the first character and the second character under respective preset character attributes. The difference and the sameness of the attribute values under each preset character attribute in the first character and the second character can be represented by one binary bit, so that the proper memory space can be allocated for the first attribute comparison value by simultaneously combining the number of the preset character attributes according to the difference and the sameness. For example, if there are 8 preset character attributes, the difference between the attribute values of the first character and the second character corresponding to the 8 preset character attributes can be represented by using 8 binary bits, and therefore, a 1-byte (total 8-bit) memory space can be allocated for the first attribute comparison value; for another example, if there are 11 preset character attributes, 11 binary bits can be used to indicate that the first character and the second character correspond to the difference and identity of the attribute values under the 11 preset character attributes, and thus, a memory space of 2 bytes (16 bits in total) can be allocated to the first attribute comparison value. By the method, the obtained first attribute comparison value can use a proper memory space, so that memory waste is avoided, and the space is saved.
And determining a first attribute comparison value according to the first attribute information and the second attribute information of the first character, and comparing the attribute values under the attributes of the preset characters respectively to obtain the first attribute comparison value. For example, if there are 3 preset character attributes, which are a font name, a color, and a font size, respectively, when determining the first attribute comparison value, it may be determined whether the font name of the first character and the font name of the second character are the same, whether the color of the first character and the color of the second character are the same, and whether the font size of the first character and the font size of the second character are the same, respectively, to determine the first attribute comparison value. If the preset character attributes are 3, the difference and identity of the attribute values under the three preset character attributes can be represented by 3 binary bits, for example, the compared difference and identity is represented by "111" by using binary bits, and then the first attribute comparison value can be determined to be 7.
In step 12, the attributes of the first character and the second character are determined to be different according to the first attribute comparison value.
After determining the first attribute comparison value, the attribute similarities and differences between the first character and the second character may be determined based on the first attribute comparison value. For example, the attribute comparison value corresponding to the attribute value of each preset character in the first character and the second character being the same is known in advance, and the attribute difference of the first character and the second character can be determined by comparing the first attribute comparison value with the attribute comparison value. For example, if it is known that the attribute comparison value corresponding to the attribute value of each preset character attribute in the first character and the second character being the same is 0, then if the first attribute comparison value is determined to be 0, it may be determined that the attributes of the first character and the second character are the same. And if it is determined that the first attribute comparison value is 2, it may be determined that the attributes of the first character and the second character are different.
According to the scheme, a first attribute comparison value is determined according to first attribute information of a first character and second attribute information of a second character, and then the attributes of the first character and the second character are different and identical according to the first attribute comparison value, wherein the attribute information of the characters comprises the attribute values of the characters under the attributes of the preset characters, and the first attribute comparison value is obtained by comparing the attribute values of the first character and the second character under the attributes of the preset characters. Therefore, the attribute comparison between the characters can be realized, the difference of the attributes of the preset characters between the characters can be determined by utilizing the first attribute comparison value, and the memory space occupied by the first attribute comparison value is small, so that even if a large number of characters needing attribute comparison exist, the memory cannot be occupied in a large amount, and the memory cost is saved.
In order to make those skilled in the art understand the technical solutions provided by the embodiments of the present invention, the following detailed descriptions are provided for the corresponding steps in the above.
First, determination of a first attribute comparison value based on first attribute information of a first character and second attribute information of a second character in step 11 is exemplified.
In a possible implementation manner, in the binary representation form corresponding to the first attribute comparison value, each binary bit corresponds to a preset character attribute, and binary values on the binary bits are used for representing that the attribute values of the first character and the second character under the preset character attribute corresponding to the bit are different. In such an embodiment, step 11 may include the steps of:
and determining the binary value of the first attribute comparison value on the binary bit corresponding to each preset character attribute in a binary representation form according to the difference and identity of the attribute value under each preset character attribute in the first character and the second character, wherein if the attribute values of the first character and the second character under a preset character attribute are the same, the binary value on the binary bit corresponding to the preset character attribute is a first value, and if the attribute values of the first character and the second character under a preset character attribute are different, the binary value on the binary bit corresponding to the preset character attribute is a second value.
The binary representation form corresponding to the first attribute comparison value is that the above-described difference and identity of the attribute values under the plurality of preset character attributes are represented by a plurality of binary bits. There may be various ways for which binary bit corresponds to which preset character attribute, which is not limited in this disclosure. Illustratively, if there are three preset character attributes (P, Q, R), and the three binary bits "XYZ" are used to represent the difference and identity of the attribute values under the three preset character attributes, XYZ may correspond to PQR in sequence, or XYZ may correspond to QRP in sequence, and there is no further description about other possible correspondence.
For example, when determining the first attribute comparison value, the first attribute comparison value may be initialized according to the number of preset character attributes. For example, if there are 5 preset character attributes, five binary bits may be used to represent that the attribute values of the first character and the second character under the 5 preset character attributes are different, then 1 byte of memory space may be allocated for the first attribute comparison value, and the first attribute comparison value is initialized to the attribute comparison value where the attribute values of the first character and the second character under the preset character attributes are the same, that is, the binary values on the 5 binary bits are corresponding to the first value. For example, if the first value is "0" and the second value is "1", when the attribute values of the preset character attributes of the first character and the second character are the same, and the corresponding binary bit is represented as "00000", the first attribute comparison value may be initialized to 0. For another example, if the first value is "1" and the second value is "0", when the attribute values of the preset character attributes of the first character and the second character are the same, the corresponding binary bit is denoted as "11111", and the first attribute comparison value may be initialized to 31.
After the first attribute comparison value is initialized, the attribute values under the preset character attributes in the first character and the second character can be compared according to the preset character attributes, and the binary value on the binary bit corresponding to the preset character attributes is updated according to the comparison result, so that the first attribute comparison value is updated until all the attribute values under the preset character attributes in the first character and the second character are compared.
Illustratively, if there are three preset character attributes (P, Q, R), the three binary digits sequentially correspond to "XYZ", and the first value is "0" and the second value is "1". Then, first, a first attribute comparison value may be initialized to 0 (binary representation form is "000"), if the attribute value comparison is performed according to the sequence of RQP, the attribute values under the preset character attribute R in the first character and the second character are compared first, and the attribute values corresponding to the two characters of R are different, then the binary representation form corresponding to the first attribute comparison value is updated from "000" to "001", the first attribute comparison value is updated to 1, then the attribute values under the preset character attribute Q in the first character and the second character are compared, and the attribute values corresponding to Q in the two characters are different, then the binary representation form corresponding to the first attribute comparison value is updated from "001" to "011", the first attribute comparison value is updated to 3, and then the attribute values under the preset character attribute P in the first character and the second character are compared, if the corresponding attribute values of P in the two characters are the same, the binary representation form corresponding to the first attribute comparison value is kept to be "011" and the first attribute comparison value is 3 when the binary representation form corresponding to the first attribute comparison value is not processed for the binary value of X bits, and the first character and the second character are not processed for the binary representation form corresponding to the first attribute comparison value
After comparing all the attribute values under the preset character attributes in the character, the current first attribute comparison value can be used as a final first attribute comparison value to provide a basis for determining the similarity and dissimilarity of the first character and the second character attribute. For example, the update of the first attribute comparison value may be updated in an order from a lower order to a higher order in the binary representation thereof, that is, the corresponding attribute values are compared in an order of the preset character attributes corresponding to the lower order to the higher order.
Through the mode, each binary bit can represent the different and same conditions of the attribute values under the preset character attributes in the binary form corresponding to the first attribute comparison value, the effect of comparing the attribute values under the preset character attributes can be achieved, meanwhile, reasonable memory space can be allocated for the first attribute comparison value, and space waste is prevented.
The following exemplifies the determination of the difference between the attributes of the first character and the second character according to the first attribute comparison value in step 12.
In one possible embodiment, step 12 may include the steps of:
if the first attribute comparison value is the same as the second attribute comparison value, determining that the attributes of the first character and the second character are the same;
and if the first attribute comparison value is different from the second attribute comparison value, determining that the attributes of the first character and the second character are different.
And the second attribute comparison value is the corresponding attribute comparison value when the attribute of each preset character in the first character and the second character is the same. For example, if there are 3 predetermined character attributes and the second attribute comparison value is 0, then if the first attribute comparison value is 2, it may be determined that the attributes of the first character and the second character are different. For another example, if there are 5 kinds of predetermined character attributes and the second attribute comparison value is 31, then if the first attribute comparison value is 31, it may be determined that the attributes of the first character and the second character are the same.
By adopting the mode, the difference and the identity of the attributes of the first character and the second character can be determined by utilizing a numerical comparison mode, and the comparison method is simple and quick.
In one possible embodiment, in addition to the steps of the method shown in fig. 1, the method provided by the present disclosure may further include the steps of:
and determining the preset character attributes with different attribute values according to the preset character attributes corresponding to each binary digit and the binary values on the binary digits of the first attribute comparison value in a binary representation form.
For example, if there are 8 preset character attributes, and the corresponding preset character attributes T1-T8 are sequentially provided, and meanwhile, binary bits corresponding to T1-T8 are changed from high to low, and the binary value "0" represents that the attribute values under the corresponding preset character attributes are the same. Then, if the first attribute comparison value is 208, it is known that the binary representation is "11010000", that is, the binary values of the binary bits corresponding to the preset character attributes T1, T2 and T4 are 1, that is, the first character attribute is different from the second character attribute, and the preset character attributes T1, T2 and T4 are different.
In addition, after the preset character attributes with different attribute values are determined, the attribute values of the preset character attributes with different attribute values in the first character and the second character respectively corresponding to the preset character attributes can be further obtained.
By the method, the obtained first attribute comparison value is analyzed to obtain the binary representation form of the first attribute comparison value, the preset character attribute with the difference of the attribute values is determined according to the preset character attribute corresponding to each binary bit and the binary value on each binary bit, and the preset character attribute with the difference of the attribute values can be determined in a simple mode.
Fig. 2 is a block diagram of a character attribute comparison apparatus provided according to an embodiment of the present disclosure. As shown in fig. 2, the apparatus 20 may include:
a first determining module 21, configured to determine a first attribute comparison value according to first attribute information of a first character and second attribute information of a second character, where the attribute information of the character includes attribute values of the character under respective preset character attributes, and the first attribute comparison value is a value obtained by comparing the attribute values of the first character and the second character under the respective preset character attributes;
a second determining module 22, configured to determine, according to the first attribute comparison value, that the attributes of the first character and the second character are different.
Optionally, in a binary representation form corresponding to the first attribute comparison value, each binary bit corresponds to one of the preset character attributes, and binary values on the binary bits are used for representing that the attribute values of the first character and the second character under the preset character attributes corresponding to the binary bits are different;
the first determining module 21 is configured to determine, according to the difference and identity of the attribute value of each preset character attribute in the first character and the second character, a binary value of the first attribute comparison value on a binary bit corresponding to each preset character attribute in a binary representation form, where if the attribute values of the first character and the second character under a preset character attribute are the same, the binary value on the binary bit corresponding to the preset character attribute is a first value, and if the attribute values of the first character and the second character under a preset character attribute are different, the binary value on the binary bit corresponding to the preset character attribute is a second value.
Optionally, the second determining module 22 is configured to determine that the attributes of the first character and the second character are the same if the first attribute comparison value is the same as a second attribute comparison value, where the second attribute comparison value is an attribute comparison value corresponding to the attribute of each of the preset characters in the first character and the second character that is the same; and if the first attribute comparison value is different from the second attribute comparison value, determining that the attributes of the first character and the second character are different.
Optionally, the apparatus 20 further comprises:
and the third determining module is used for determining the preset character attributes with different attribute values according to the preset character attributes corresponding to each binary digit and the binary values on the binary digits in the binary representation form of the first attribute comparison value.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 3 is a block diagram of an electronic device shown in accordance with an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 3, electronic device 1900 includes a processor 1922, which can be one or more in number, and memory 1932 for storing computer programs executable by processor 1922. The computer program stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processor 1922 may be configured to execute the computer program to perform the character attribute comparison method described above.
Additionally, electronic device 1900 may also include a power component 1926 and a communication component 1950, the power component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 1900. In addition, the electronic device 1900 may also include input/output (I/O) interfaces 1958. The electronic device 1900 may operate based on an operating system, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, etc., stored in memory 1932.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the character attribute comparison method described above. For example, the computer readable storage medium may be the above-described memory 1932 including program instructions that are executable by the processor 1922 of the electronic device 1900 to perform the character attribute comparison method described above.
The preferred embodiments of the present disclosure are described in detail above with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details in the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A character attribute comparison method, the method comprising:
determining a first attribute comparison value according to first attribute information of a first character and second attribute information of a second character, wherein the attribute information of the character comprises attribute values of the character under each preset character attribute, the first attribute comparison value is a value obtained by comparing the attribute values of the first character and the second character under each preset character attribute, each binary bit corresponds to one preset character attribute in a binary representation form corresponding to the first attribute comparison value, binary values on the binary bits are used for representing that the attribute values of the first character and the second character under the preset character attribute corresponding to the binary bits are different, and a memory space used by the first attribute comparison value is distributed according to the number of the preset character attributes;
and determining that the attributes of the first character and the second character are different according to the first attribute comparison value.
2. The method of claim 1, wherein determining the first attribute comparison value based on the first attribute information for the first character and the second attribute information for the second character comprises:
and determining the binary value of the first attribute comparison value on the binary bit corresponding to each preset character attribute in a binary representation form according to the difference and identity of the attribute value under each preset character attribute in the first character and the second character, wherein if the attribute values of the first character and the second character under a preset character attribute are the same, the binary value on the binary bit corresponding to the preset character attribute is a first value, and if the attribute values of the first character and the second character under a preset character attribute are different, the binary value on the binary bit corresponding to the preset character attribute is a second value.
3. The method of claim 1, wherein determining that the attributes of the first character and the second character are different according to the first attribute comparison value comprises:
if the first attribute comparison value is the same as a second attribute comparison value, determining that the attributes of the first character and the second character are the same, wherein the second attribute comparison value is an attribute comparison value corresponding to the attribute of each preset character in the first character and the second character when the attribute values of the preset character in the first character and the second character are the same;
and if the first attribute comparison value is different from the second attribute comparison value, determining that the attributes of the first character are different from the attributes of the second character.
4. The method according to any one of claims 1-3, further comprising:
and determining the preset character attributes with different attribute values according to the preset character attributes corresponding to each binary digit and the binary values on the binary digits of the first attribute comparison value in a binary representation form.
5. An apparatus for comparing character attributes, the apparatus comprising:
a first determining module, configured to determine a first attribute comparison value according to first attribute information of a first character and second attribute information of a second character, where the attribute information of the character includes attribute values of the character under respective preset character attributes, the first attribute comparison value is a value obtained by comparing the attribute values of the first character and the second character under the respective preset character attributes, each binary bit corresponds to one of the preset character attributes in a binary representation form corresponding to the first attribute comparison value, a binary value on the binary bit is used to represent that the attribute values of the first character and the second character under the preset character attributes corresponding to the bit are different, and a memory space used by the first attribute comparison value is allocated according to the number of the preset character attributes;
and the second determining module is used for determining the attribute difference of the first character and the second character according to the first attribute comparison value.
6. The apparatus of claim 5, wherein the first determining module is configured to determine, according to the difference and identity of the attribute value of each of the first character and the second character under the preset character attribute, a binary value of the first attribute comparison value on the binary bit corresponding to each preset character attribute under the binary representation form, where if the attribute values of the first character and the second character under a preset character attribute are the same, the binary value on the binary bit corresponding to the preset character attribute is a first value, and if the attribute values of the first character and the second character under a preset character attribute are different, the binary value on the binary bit corresponding to the preset character attribute is a second value.
7. The apparatus of claim 5, wherein the second determining module is configured to determine that the attributes of the first character and the second character are the same if the first attribute comparison value is the same as a second attribute comparison value, where the second attribute comparison value is an attribute comparison value corresponding to the attribute of each of the preset characters in the first character and the second character that is the same; and if the first attribute comparison value is different from the second attribute comparison value, determining that the attributes of the first character and the second character are different.
8. The apparatus of any of claims 5-7, further comprising:
and the third determining module is used for determining the preset character attributes with different attribute values according to the preset character attributes corresponding to each binary digit and the binary values on the binary digits in the binary representation form of the first attribute comparison value.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1-4.
CN201811625226.5A 2018-12-28 2018-12-28 Character attribute comparison method and device, storage medium and electronic equipment Active CN109840080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811625226.5A CN109840080B (en) 2018-12-28 2018-12-28 Character attribute comparison method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811625226.5A CN109840080B (en) 2018-12-28 2018-12-28 Character attribute comparison method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109840080A CN109840080A (en) 2019-06-04
CN109840080B true CN109840080B (en) 2022-08-26

Family

ID=66883462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811625226.5A Active CN109840080B (en) 2018-12-28 2018-12-28 Character attribute comparison method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109840080B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116187625B (en) * 2023-04-24 2023-07-14 中国西安卫星测控中心 Space survey operation control resource scheduling plan comparison method and device based on bit operation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117733A (en) * 2015-07-27 2015-12-02 中国联合网络通信集团有限公司 Method and device for determining clustering sample difference
CN106407201A (en) * 2015-07-29 2017-02-15 腾讯科技(深圳)有限公司 Data processing method and apparatus
CN107153651A (en) * 2016-03-03 2017-09-12 阿里巴巴集团控股有限公司 A kind of multidimensional intersects data processing method and processing device
CN108156140A (en) * 2017-12-13 2018-06-12 西安电子科技大学 A kind of multiple key that numerical attribute is supported to compare can search for encryption method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5225833A (en) * 1989-10-20 1993-07-06 Digital Equipment Corporation Character encoding
US8725497B2 (en) * 2011-10-05 2014-05-13 Daniel M. Wang System and method for detecting and correcting mismatched Chinese character
CN103559413B (en) * 2013-11-15 2016-11-02 北京搜房科技发展有限公司 A kind of data processing method and device
CN106557553B (en) * 2016-10-27 2020-06-05 东软集团股份有限公司 Data matching method and device
CN108090082B (en) * 2016-11-22 2021-06-11 腾讯科技(北京)有限公司 Information processing method and information processing apparatus
CN108572947B (en) * 2017-03-13 2019-11-19 腾讯科技(深圳)有限公司 A kind of data fusion method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117733A (en) * 2015-07-27 2015-12-02 中国联合网络通信集团有限公司 Method and device for determining clustering sample difference
CN106407201A (en) * 2015-07-29 2017-02-15 腾讯科技(深圳)有限公司 Data processing method and apparatus
CN107153651A (en) * 2016-03-03 2017-09-12 阿里巴巴集团控股有限公司 A kind of multidimensional intersects data processing method and processing device
CN108156140A (en) * 2017-12-13 2018-06-12 西安电子科技大学 A kind of multiple key that numerical attribute is supported to compare can search for encryption method

Also Published As

Publication number Publication date
CN109840080A (en) 2019-06-04

Similar Documents

Publication Publication Date Title
CN106598574B (en) Page rendering method and device
CN108388598B (en) Electronic device, data storage method, and storage medium
CN108427731B (en) Page code processing method and device, terminal equipment and medium
CN109558525B (en) Test data set generation method, device, equipment and storage medium
US20170083495A1 (en) Method for Modifying Webpage and Apparatus for Modifying Webpage
CN111159329B (en) Sensitive word detection method, device, terminal equipment and computer readable storage medium
CN106970820A (en) Code storage method and code storage
CN109145235B (en) Method and device for analyzing webpage and electronic equipment
CN111249736B (en) Code processing method and device
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
WO2013137864A1 (en) Submatch extraction
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN111831920A (en) User demand analysis method and device, computer equipment and storage medium
CN110851136A (en) Data acquisition method and device, electronic equipment and storage medium
CN109840080B (en) Character attribute comparison method and device, storage medium and electronic equipment
CN112486490B (en) Front-end code packaging method and device, electronic equipment and storage medium
CN113032275A (en) Method and device for testing field, electronic equipment and storage medium
CN110134920A (en) Draw the compatible display methods of text, device, terminal and computer readable storage medium
CN113742332A (en) Data storage method, device, equipment and storage medium
CN108196921B (en) Document development method and device, computer equipment and storage medium
CN113703753B (en) Method and device for product development and product development system
CN110543641A (en) chinese and foreign language information comparison method and device
CN112417020B (en) Service expansion realization method, device, computer equipment and storage medium
CN114462381A (en) Data processing method, device, equipment and storage medium
CN114579580A (en) Data storage method and data query method and device

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