CN111967274B - Label conversion processing method and device, electronic equipment and readable storage medium - Google Patents

Label conversion processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN111967274B
CN111967274B CN202010867140.4A CN202010867140A CN111967274B CN 111967274 B CN111967274 B CN 111967274B CN 202010867140 A CN202010867140 A CN 202010867140A CN 111967274 B CN111967274 B CN 111967274B
Authority
CN
China
Prior art keywords
tag
label
target
name
file
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
CN202010867140.4A
Other languages
Chinese (zh)
Other versions
CN111967274A (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.)
Wensihai Huizhike Technology Co ltd
Original Assignee
Wensihai Huizhike Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wensihai Huizhike Technology Co ltd filed Critical Wensihai Huizhike Technology Co ltd
Priority to CN202010867140.4A priority Critical patent/CN111967274B/en
Publication of CN111967274A publication Critical patent/CN111967274A/en
Application granted granted Critical
Publication of CN111967274B publication Critical patent/CN111967274B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a label conversion processing method, a device, electronic equipment and a readable storage medium, wherein the method comprises the following steps: identifying a target label in a file to be translated, wherein the target label is a label with a logic paired label characteristic; judging the label type of the target label according to the label type characteristics in the logic paired label characteristics; the tag type includes a logical start tag or a logical end tag; determining a replacement label name of the target label according to the label name of the target label; generating an update tag according to the tag type and the replacement tag name so that the update tag can be identified as a pair of tags in form; the target tag is replaced with an update tag. In this way, because the target label is replaced for updating the label, and the updating label can be identified, the independent label logically belonging to the label pair can be correctly placed by the translator in the translation process, thereby reducing the requirement on the computer expertise of the translator and improving the quality and efficiency of the translation operation.

Description

Label conversion processing method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a tag conversion processing method, a tag conversion processing device, an electronic device, and a readable storage medium.
Background
Often there are labels in the file that can be formally separated into label pairs (i.e., a start label and an end label) and individual labels. To facilitate identification and handling of these tags by the translator, and to reduce the technical knowledge reserve requirements for the translator, CAT (Computer Assitant Tool, computer-aided translation tool) would handle these tags as different appearances (shape on both the left and right sides), such as: the start tag will be treated asThe end tag will be treated as/>The individual tag will be treated as "■". Thus, the translator can accurately judge the label type through the appearance of the label so as to ensure that the starting label and the ending label can be correctly paired, and the proper text is wrapped. Especially, because the characteristics of the source language and the target language are different, when the language sequence needs to be adjusted in the translation, the translator is more dependent on the function.
However, in some types of files, there is a special class of tags that, although in the form of individual tags, functionally belong to turning on or off a certain characteristic or action, or represent a starting or ending position of a certain range. I.e. logically belonging to a tag pair. At present, CAT uniformly processes the special independent label and the common independent label of the logic pairing as '■' of the appearance of the independent label. This can easily lead a translator to misinterpret such special independent tags as ordinary independent tags, potentially resulting in a tag that cannot be paired (e.g., a tag with a start function is located after a tag with an end function, or one of the paired parties is missing). Meanwhile, in order to avoid such errors, a translator needs to make a certain technical knowledge store to know the corresponding file format coding knowledge so as to identify such special tags.
Disclosure of Invention
The embodiment of the application aims to provide a tag conversion processing method, a tag conversion processing device, electronic equipment and a readable storage medium, which are used for solving the problems that the special independent tags logically belonging to a tag pair cannot be distinguished in the related technology, so that the computer expertise requirement of a translator is improved and the quality and efficiency of translation operation are reduced.
The embodiment of the application provides a label conversion processing method, which comprises the following steps: identifying a target label in a file to be translated, wherein the target label is a label with a logic paired label characteristic; judging the label type of the target label according to the label type characteristics in the logic paired label characteristics; the tag type includes a logical start tag or a logical end tag; determining a replacement label name of the target label according to the label name of the target label; generating an update tag based on the tag type and the replacement tag name, such that the update tag can be identified as a formally paired tag; and replacing the target label with the updated label.
In the embodiment of the application, the label type is determined by identifying the target label in the file to be translated and according to the label type characteristics in the label characteristics of the target label in the logic pair. And determining a corresponding replacement label name according to the label name of the target label, so that an update label is generated according to the label type and the replacement label name, the update label can be identified as a pair of labels in form, and finally the target label is replaced by the update label. In this way, as the target label is replaced for updating the label and the updated label can be identified, when translation is carried out, the independent labels logically belonging to the label pair can be translated differently, so that a translator can distinguish the special independent labels logically belonging to the label pair, the requirement on the computer expertise of the translator is reduced, and the quality and efficiency of translation operation are improved.
Further, identifying the target tag in the file to be translated includes: acquiring a label name and/or a label attribute of a label in the file to be translated, and identifying whether the label name and/or the label attribute contains the logic paired label characteristics or not; and if the tag name and/or the tag attribute contain the logic paired tag characteristics, determining that the tag is the target tag.
In practical application, compared with other common independent labels, since the independent labels with the characteristics of the logic paired labels need to be able to logically realize the functions of the label pairs, the independent labels with the characteristics of the logic paired labels often need to have the characteristics of corresponding identification logic paired characteristics in terms of names and/or label attributes, such as the characteristics of start and end, while the independent labels without the characteristics of the logic paired labels (i.e. common independent labels) do not have the characteristics. Accordingly, in the implementation process, the identification and determination of the target tag can be quickly and reliably realized by identifying whether the tag name and/or the tag attribute contain the logic paired tag features.
Further, determining the replacement label name of the target label according to the label name of the target label includes: and determining a preset replacement label corresponding to the label name of the target label as the replacement label according to a preset corresponding relation.
Further, the generating an update tag according to the tag type and the replacement tag name includes: if the tag type is a logic start tag, acquiring the target tag, and replacing the tag name of the target tag with the replacement tag name to obtain the updated tag; if the tag type is a logic ending tag, acquiring the target tag, replacing the tag name of the target tag with the replacement tag name, adding an ending tag identifier before the replacement tag name, and defaulting the tag attribute of the target tag to obtain the updated tag.
It should be appreciated that in the actual application process, the CAT translation can allow the tag to be specific to the default portion, as long as the tag has a corresponding end tag identification thereafter. For this reason, in the embodiment of the present application, it is allowed that the start tag identification is not set for the logical start tag, but the end tag identification is set for the logical end tag, so that the tag can be simplified on the basis of satisfying the relevant translation requirement. In addition, CAT translation requires its omit tag attribute for the end tag in the tag pair. Therefore, the label attribute of the target label can be defaulted in the application, so that the update label corresponding to the logic end label can be effectively identified by CAT.
Further, the method further comprises: determining the file type of the file to be translated; and determining the logic paired tag characteristics for identifying the target tag according to the file type.
It should be appreciated that in a practical application, the particular type of individual tags belonging to a tag pair may be different among different types of files, with the logical pair tag features available to implement the logical pair function. For example, for a certain class of files, the logical paired tag characteristics of the individual tags within the tag pair may be "start" and "end", while for another class of files, the logical paired tag characteristics of the individual tags within the tag pair may be "open" and "close". In the implementation process, the logic paired tag characteristics for identifying the target tag are determined according to the file type of the file to be translated, so that the effective identification of the target tag in the embodiment of the application can be ensured, and the reliability of the scheme provided by the embodiment of the application is ensured.
Further, the method further comprises: judging whether the target label comprises a pairing group distinguishing attribute or not; and if so, configuring the pairing group distinguishing attribute in the updated label according to the pairing group distinguishing attribute in the target label.
In the practical application process, there may be multiple pairs (i.e. multiple pairing groups) of independent labels belonging to a label pair, and in order to distinguish the independent labels of different pairing groups, a pairing group distinguishing attribute is set in the labels, so as to distinguish the independent labels belonging to the label pair of different pairs. Through the implementation process, the replaced update label can realize corresponding functions according to the set pairing group after translation, so that logic errors in translation are avoided.
Further, the method further comprises: recording the corresponding relation between the target label and the update label; if a translation completion instruction is received, replacing the update label with the target label in a translation completion file; the translation completion file is a file after the translation of the file to be translated is completed, and the label in the file to be translated is reserved in the translation completion file.
In the implementation process, the update label is replaced by the target label in the translation completion file, so that the consistency of the labels in the translation completion file and the original file can be ensured, and the translation completion file is convenient for subsequent operation.
The embodiment of the application also provides a label conversion processing device, which comprises: the device comprises an identification module, a judging module, a determining module and a replacing module; the identification module is used for identifying a target label in the file to be translated, wherein the target label is a label with a logic paired label characteristic; the judging module is used for judging the label type of the target label according to the label type characteristics in the logic paired label characteristics; the tag type includes a logical start tag or a logical end tag; the determining module is further configured to determine a replacement label name of the target label according to the label name of the target label; the replacing module is used for generating an updated label according to the label type and the replacing label number so that the updated label can be identified as a pair of labels in form; and replacing the target label with the updated label.
The embodiment of the application also provides electronic equipment, which comprises: a controller, a memory, and a communication bus; the communication bus is used for realizing connection communication between the controller and the memory; the controller is configured to execute one or more programs stored in the memory to implement any one of the tag conversion processing methods described above.
The embodiment of the application also provides a readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more controllers to realize the label conversion processing method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a basic flow diagram of a label conversion processing method according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a special independent label according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a specific label conversion processing method according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of a label conversion processing device according to an embodiment of the present application;
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Embodiment one:
In order to solve the problem that the related art cannot distinguish a special independent label logically belonging to a label pair, thereby improving the requirement of computer expertise of a translator and reducing the quality and efficiency of translation operation, the embodiment of the application provides a label conversion processing method, which is shown in fig. 1 and comprises the following steps:
S101: target tags in the file to be translated are identified.
In the embodiment of the application, the file to be translated can be provided by an engineer according to the actual translation requirement or read from the related file system according to the actual translation requirement.
In the embodiment of the present application, the target tag refers to a form of an independent tag in the file to be translated, but logically belongs to an independent tag (for convenience of description, the independent tag logically belongs to a tag pair is referred to as a special independent tag in the present application) of a tag pair (i.e. functionally belongs to a feature or action of turning on or off, or represents a starting or ending position of a certain range).
In an embodiment of the application, the target tag has a tag with a logical paired tag feature. By logical paired tag feature, it is meant that the portion of a particular individual tag that is enabled to perform the tag pair function is different from the features of a normal individual tag, such as having "start" and "end", "open" and "close", "1" or "0" features.
It should be appreciated that in a practical application, the logical pair tag characteristics of a particular individual tag may be different for different types of files. For example, for a certain class of files, the logical paired tag characteristics of the individual tags within the tag pair may be "start" and "end", while for another class of files, the logical paired tag characteristics of the individual tags within the tag pair may be "open" and "close".
Therefore, in the embodiment of the application, the corresponding relation between each type of file and the logic paired tag features can be recorded in advance, so that the file type of the file to be translated can be determined first, and then the corresponding logic paired tag features can be determined according to the file type.
In the embodiment of the application, based on the characteristics of the logic paired tags, a special independent tag can be identified from the file to be translated, and the identified special independent tag is the target tag.
In practical application, referring to fig. 2, for a special independent tag of the element class of the processing instruction (Processing Instruction), the structure is as follows: <? TARGET DATA? > is provided. Where "target" designates a processor that processes instructions and "data" is the content of the instructions. For ease of description, the present application will refer to "target" as the label and "data" as the label attribute. For example, for a special independent tag <? rb-cbt _ START NAME = "student"? Sum? rb-cbt _end? "rb-cbt _start" and "rb-cbt _end" are tag names, and "name=" student "is a tag attribute. In addition, there are special independent labels of the general element class, for example, special independent labels < bookmark type= "start"/>, and < bookmark type= "end"/>, where "bookmark" is a label name, and "type=" start "," and "type=" end "are label attributes.
It should be understood that a tag may have multiple specific attributes in its tag attributes. For example, two attributes of "type=" start "," id= "1", and "type=" may be simultaneously present.
It should be further noted that, in the practical application, since a special independent tag needs to be able to logically implement the function of a tag pair, it is often required to have a feature of identifying the logical pairing property on the tag name and/or the tag attribute, whereas an independent tag without the logical pairing tag feature (i.e. a common independent tag) does not have such a feature. For example, for the previous example, "start" and "end" in the tag attribute are features that identify the logical pairing property; for another example, for a special independent tag <? rb-cbt _ START NAME = "student"? Sum? rb-cbt _end? The "start" and "end" in the tag names "rb-cbt _start" and "rb-cbt _end" are features that identify the logical pairing property. It should be appreciated that in addition to the two examples described above, there may be cases where both the tag name and tag attribute have features identifying logical pairing characteristics, which are not examples herein.
Therefore, in the embodiment of the application, the tag name and/or the tag attribute of the tag in the file to be translated can be obtained, and whether the tag name and/or the tag attribute contain the logic paired tag features or not can be identified. If the tag name and/or tag attribute includes a logical paired tag feature, the tag may be determined to be a target tag. Therefore, the target label in the file to be translated can be rapidly and reliably identified based on the distinguishing characteristics of the special independent label and the common independent label.
S102: and judging the label type of the target label according to the label type characteristics in the logic paired label characteristics.
In the practical application process, the conventional label pair is composed of a start label and an end label, and the special independent label is similar to the conventional label pair, and a pairing group is formed by a label for realizing the start function and a label for realizing the end function together to logically realize the function of the complete label pair.
Thus, in practice, the tag type feature will be present in the logical pair tag feature of a particular individual tag to identify whether the particular individual tag logically implements the start or end function of the tag pair.
In the embodiment of the present application, the tag type feature defining the start function for identifying that a particular independent tag logically implements a tag pair is a first type tag type feature, such as "start", "open", etc., and the tag type feature defining the end function for identifying that a particular independent tag logically implements a tag pair is a second type tag type feature, such as "end", "close", etc.
When the tag type features in the logic paired tag features are identified as the first type tag type features, the tag type of the target tag can be determined to be a logic start tag, and when the tag type features in the logic paired tag features are identified as the second type tag type features, the tag type of the target tag can be determined to be a logic end tag.
In an embodiment of the present application, the logical start tag and the logical end tag correspond to a start tag and an end tag, respectively, of a conventional tag pair.
S103: and determining the replacement label name of the target label according to the label name of the target label.
In a feasible implementation manner of the embodiment of the application, the replacement label names corresponding to various label names can be predefined, and a corresponding relation table between the label names and the replacement label names is configured, so that the corresponding replacement label names can be automatically searched and obtained according to the label names of the target labels.
It should be noted that in this possible embodiment, the defined replacement signature should satisfy the parsing rule of the computer-aided translation tool, so that the computer-aided translation tool can correctly identify the replacement signature. Exemplary, for a particular independent tag <? rb-cbt _ START NAME = "student"? The tag name "rb-cbt _start" may define a tag name "q_ cbt" in the form of a start tag in a conventional tag pair. Therefore, in the scheme execution process, the determined replacement label of the label name 'rb-cbt _start' is 'Q_ cbt', so that the computer-aided translation tool can accurately identify the replacement label.
In another possible implementation manner of the embodiment of the present application, an engineer may also configure a corresponding tag name conversion rule in advance, so that the tag name of the target tag is automatically converted into the replacement tag name according to the tag name conversion rule.
It should also be noted that in this possible embodiment, the tag name conversion rule is configured such that the converted replacement tag name can satisfy the parsing rule of the computer-aided translation tool, so that the computer-aided translation tool can correctly identify the replacement tag name. For example, a tag name conversion rule may be configured to convert the tag name of the target tag to an inherent tag span of HTML (HyperText Markup Language ). For example, tag name <? rh-cbt > can be converted to < SPAN CLASS = "cbt", so that the computer-aided translation tool can accurately identify the replacement tag < SPAN CLASS = "cbt".
S104: based on the tag type and the replacement tag number, an update tag is generated so that the update tag can be identified as a formally paired tag.
S105: the target tag is replaced with an update tag.
In the embodiment of the application, the rest of contents except the label in the label can be inherited or can be defaulted, and the method specifically takes the recognition of the computer-aided translation tool as the reference, so that the updated label is generated.
In the embodiment of the application, for the target label with the label type being the logic start label, the label name of the target label can be directly replaced by the replacement label name, so that the updated label is obtained, because the computer-aided translation tool allows the default representation of the start label as the identification of the start label. It is of course also possible to add a start tag identification to the target tag after its tag name has been replaced with a replacement tag name, in order for the computer-aided translation tool to determine that it is a logical start tag in a special stand-alone tag.
For the target tag with the tag type being the logic ending tag, in order to ensure that the computer-aided translation tool can accurately identify two special independent tags forming the logic tag pair, not only the tag name of the target tag needs to be replaced by a replacement tag name, but also an ending tag identifier needs to be added before the replacement tag name is replaced, so that the computer-aided translation tool can accurately identify the corresponding logic starting tag and logic ending tag.
Illustratively, for text:
<?rb-cbt_start name="student teacher"?>Quiz for students&teachers<?rb-cbt_end?><?rb-cbt_start name="teacher"?>
Answer for teachers only<?rb-cbt_end?>
< intext? rb-cbt _ START NAME = "student tester"? Is? rb-cbt _end? Is a pair of special independent tags; but <? rb-cbt _ START NAME = "teacher"? Sum? rb-cbt _end? But another pair of special independent tags. The text may be converted into:
<Q_cbt name="student teacher">Quiz for students&teachers</Q_cbt><Q_cbt name="teacher">
Answer for teachers only</Q_cbt>
It can be seen that the tag before conversion <? rb-cbt _ START NAME = "student tester"? Conversion to < q_ cbt name = "student means" >, the flag "_start" for indicating that it is a start tag is default, and tag <? rb-cbt _end? The conversion is for Q_ cbt > with an end tag identification "/", whereby the computer aided translation tool can determine that the logical start tag is the preceding tag < Q_ cbt name = "student teacher" >, and the logical end tag is Q_ cbt >.
Similarly, the computer-aided translation tool can determine a logical start tag < Q_ cbt name = "teacher" > and a logical end tag </Q_ cbt >, thereby achieving accurate translation of text.
By tags in pairs, it is meant that tags have the same tag number and an end identifier in the end tag so that the computer-aided translation tool can identify them as a pair of tags. Such as the forms < a > and < a >, etc.
It should be noted that for the computer-aided translation tool, it requires default tag properties for the end tag. Thus, for a special independent tag belonging to a logical end tag, it is necessary to default the tag attribute of the special independent tag at the time of conversion. For example, for a special independent tag < bookmark type= "end"/>, the updated tag obtained after conversion can be "bookmark >, and the tag attribute" type= "end" ", is omitted.
It should be understood that there are often multiple sets of paired special independent labels in one text, such as having two sets of paired special independent labels as in the above example.
In practical application, in addition to the case of multiple sets of paired special independent labels in the previous example, there may be cases that the special independent labels of each set of paired special independent labels are nested with each other, so that the relationship between each set of special independent labels needs to be defined. In order to more clearly determine the corresponding relation of each group of special independent labels, a pairing group distinguishing attribute is often arranged in the labels. For example, for a tag < w: bookmarkStart w:id= "0" >, where "id=" 0"" is a pairing group distinguishing attribute, the tag is identified to belong to a pairing group with ID of 0.
In the embodiment of the present application, if the target tag includes the pairing group distinguishing attribute, the pairing group distinguishing attribute in the updated tag may be configured according to the pairing group distinguishing attribute in the target tag.
It should be understood that, in the embodiment of the present application, the update of the pairing group distinguishing attribute may inherit the pairing group distinguishing attribute in the original tag, but the pairing group distinguishing attribute may also be regenerated via a specific conversion or encoding rule. For example, for "id=" 0 "in the above example, i.e., renumbering may be done such that id=" 1 "or id takes the remaining identifiable characters.
It should be noted that the pairing group distinguishing attribute belongs to one of the tag attributes, and thus for a particular individual tag belonging to a logical end tag, a default needs to be made when generating an updated tag. However, in order to make the computer-aided translation tool accurately determine two special independent tags belonging to the same pairing group, in the embodiment of the application, when generating the update tag, the generated pairing group distinguishing attribute may be added to the tag name as a part of the tag name, so that on the basis of meeting the recognition requirement of the computer-aided translation tool, the accurate recognition of the two special independent tags belonging to the same pairing group can be realized.
It should be noted that, in the embodiment of the present application, as long as the conversion manner of the pairing group distinguishing attribute is adopted, two special independent labels of the same pairing group can be enabled, and the pairing group distinguishing attribute after conversion is still consistent and can be identified by the computer-aided translation tool. And is not limited to a specific implementation thereof.
In the embodiment of the application, after the target label is replaced by the update label, the corresponding relation between the target label and the update label can be recorded. Further, the update tag may be replaced back with the target tag in the translation completion file upon receiving the translation completion instruction.
It should be understood that the translation completion file is a file after the translation of the file to be translated is completed, and the label in the file to be translated is reserved in the translation completion file. In this way, the consistency of the translation completion file and the labels in the original file can be ensured, so that the translation completion file is convenient for subsequent operation.
According to the label conversion processing method provided by the embodiment of the application, the label type is determined by identifying the target label in the file to be translated and according to the label type characteristics in the label pair characteristics of the logic of the target label. And determining a corresponding replacement label name according to the label name of the target label, so that an update label is generated according to the label type and the replacement label name, the update label can be identified as a pair of labels in form, and finally the target label is replaced by the update label. In this way, as the target label is replaced for updating the label and the updated label can be identified, when translation is carried out, the independent labels logically belonging to the label pair can be translated differently, so that a translator can distinguish the special independent labels logically belonging to the label pair, the requirement on the computer expertise of the translator is reduced, and the quality and efficiency of translation operation are improved.
Embodiment two:
The embodiment of the present application is based on the first embodiment, and a specific label conversion processing procedure is taken as an example to describe the scheme of the present application.
Referring to fig. 3, the label conversion process includes:
s301: and acquiring the file to be translated, and determining the file type of the file to be translated.
S302: logical paired tag characteristics for identifying the target tag are determined based on the file type.
S303: and obtaining the label name and label attribute of the label in the file to be translated.
S304: whether a logical paired tag feature is included in the tag name and/or tag attribute is identified. If so, step S305 is performed; otherwise, ending.
S305: and determining a replacement label corresponding to the label name of the target label according to the preset label name corresponding relation.
S306: and determining the label type of the target label according to the label type characteristics in the logic paired label characteristics.
It should be understood that there is no timing limitation between steps S305 and S306. That is, step S305 may be performed before step S306, may be performed after step S306, or may be performed simultaneously with step S306.
S307: and when the label type is a logic start label, acquiring the target label, and replacing the label name of the target label with a replacement label name to obtain an updated label.
S308: when the label type is a logic ending label, acquiring the target label, replacing the label name of the target label with a replacement label name, adding an ending label mark before replacing the label name, and defaulting the label attribute of the target label to obtain an updated label.
S309: judging whether the target label comprises the pairing group distinguishing attribute or not, if so, turning to step S310; otherwise, go to step S311.
S310: and configuring the pairing group distinguishing attribute in the updated label according to the pairing group distinguishing attribute in the target label.
S311: and replacing the target label with the updated label, and recording the corresponding relation between the target label and the updated label.
S312: when a translation completion instruction is received, the update tag is replaced with the target tag in the translation completion file.
In the following, two sets of text cases are illustrated that implement conversion by embodiments of the present application:
Case one: ( Robo (robot) Help (Help) source file: processing instruction (Processing Instruction) tag for start or end position of conditional text )
Before conversion, the method comprises the following steps:
<?rb-cbt_start name="student teacher"?>Quiz for students&teachers<?rb-cbt_end?><?rb-cbt_start name="teacher"?>
Answer for teachers only<?rb-cbt_end?>
or is:
<?rb-cbt_start name="teacher student"?>Quiz for students&teachers<?rb-cbt_end?><?rb-cbt_start name="teacher"?>
Answer for teachers only<?rb-cbt_end?>
The conversion is as follows:
<Q_cbt name="student teacher">Quiz for students&teachers</Q_cbt><Q_cbt name="teacher">
Answer for teachers only</Q_cbt>
(code action interpretation: when the student condition is externally given, only the text controlled by the student condition is displayed, i.e. "Quiz for students", and when the teacher condition is externally given, the scope controlled by the teacher condition is displayed, i.e. "Quiz for students & teachers" and "Answer for teachers only").
In the above code, "rb-cbt _start" and "rb-cbt _end" are paired with each other according to a name attribute for marking a controlled text range. In addition, in the two code segments before conversion, the "name=" student's tool "," name "" describe two objects, "reagent" and "student", and thus are identical in nature, so that the two code segments can be converted into the code segments after conversion.
Note that, for "name=" student's means "and" name= "student's means" in the former code, which are pairing group distinguishing attributes in the tag, it is also possible to convert into the remaining form. For example, a binary bit conversion rule may be set, and student= 2^0 =1, and teacher= 2^1 =2, and when both occur at the same time, the two are added to obtain the combined id: student teacher=3.
The converted code is: < q_ cbt id = "3" > Quiz for students & teachers q_ cbt > < q_ cbt id = "2" >
Answer for teachers only</Q_cbt>
Case two: (Open Xml Document bookmark labels for the starting or ending position)
W: bookmarkstart and w: bookmarkend are paired with each other according to the w:id attribute for marking the text range controlled by the bookmark.
Before conversion, the method comprises the following steps:
<w:bookmarkStart w:id="0"w:name="Test"/><w:r><w:rPr><w:rFontsw:hint="eastAsia"/><w:lang w:val="en-US"w:eastAsia="zh-CN"/></w:rPr><w:t> Scheme (w: t > </w: r > < w: bookmarkEnd w: id= "0"/>)
The conversion is as follows:
<bookmark id="0"><w:r><w:rPr><w:rFonts w:hint="eastAsia"/><w:lang w:val="en-US"w:eastAsia="zh-CN"/></w:rPr><w:t> Scheme (t > </w: r > </book >)
Or is:
<bookmark id="1"><w:r><w:rPr><w:rFonts w:hint="eastAsia"/><w:lang w:val="en-US"w:eastAsia="zh-CN"/></w:rPr><w:t> Scheme (t > </w: r > </book >)
In the above example, the first converted code, the pairing group distinguishing attribute is not changed, and still remains as id= "0", while the second converted code, the pairing group distinguishing attribute is reassigned, id= "1". Both of these approaches can be accurately identified by the computer-aided translation tool, and are feasible.
According to the scheme provided by the embodiment of the application, the pairing labeling processing of the class starting/ending labels is realized on the premise of not influencing the original CAT processing logic by identifying and replacing the special independent labels, so that misleading of a translator is avoided, and the translation quality and efficiency are improved. Meanwhile, the original CAT logic is not affected, so that the modification workload is small, and the implementation and popularization are easy.
Embodiment III:
Based on the same inventive concept, the embodiment of the application also provides a label conversion processing device applied to the electronic equipment. Referring to fig. 4, fig. 4 shows a label switching processing apparatus 100 corresponding to the method of the first embodiment. It should be appreciated that the specific functions of the label switching processing apparatus 100 may be referred to the above description, and detailed descriptions thereof are appropriately omitted for the sake of avoiding repetition. The tag conversion processing device 100 includes at least one software functional module that can be stored in a memory in the form of software or firmware or cured in the operating system of the tag conversion processing device 100. Specifically:
Referring to fig. 4, the tag conversion processing apparatus 100 includes: an identification module 101, a judgment module 102, a determination module 103 and a replacement module 104. Wherein:
the identifying module 101 is configured to identify a target tag in a file to be translated, where the target tag is a tag with a logical paired tag feature;
The judging module 102 is configured to judge a tag type of the target tag according to a tag type feature in the logical paired tag features; the tag type includes a logical start tag or a logical end tag;
the determining module 103 is configured to determine a replacement label name of the target label according to a label name of the target label;
The replacing module 104 is configured to generate an updated tag according to the tag type and the replacing tag name, so that the updated tag can be identified as a pair of tags in form; and replacing the target label with the updated label.
In the embodiment of the present application, the identification module 101 is specifically configured to obtain a tag name of a tag in the file to be translated, and identify whether the tag name includes the logical paired tag feature; and if the tag name contains the logic paired tag characteristics, determining the tag as the target tag.
In this embodiment of the present application, the determining module 103 is specifically configured to determine, according to a preset correspondence, a preset replacement tag name corresponding to a tag name of the target tag as the replacement tag name.
In a possible implementation manner of the embodiment of the present application, the replacing module 104 is specifically configured to obtain the target tag if the tag type is a logic start tag, and replace the tag name of the target tag with the replacing tag name to obtain the updated tag; and if the label type is a logic ending label, acquiring the target label, replacing the label name of the target label with the replacement label name, and adding an ending label mark before the replacement label name to acquire the updated label.
In the embodiment of the present application, the determining module 103 is further configured to determine a file type of the file to be translated; and determining the logic paired tag characteristics for identifying the target tag according to the file type.
In the embodiment of the present application, the tag conversion processing device 100 further includes a configuration module, configured to determine whether the target tag includes a pairing group distinguishing attribute; and if so, configuring the pairing group distinguishing attribute in the updated label according to the pairing group distinguishing attribute in the target label.
In this embodiment of the present application, the tag conversion processing apparatus 100 further includes a recording module, configured to record a correspondence between the target tag and the update tag. The replacing module 104 is further configured to replace the update tag with the target tag in the translation completion file if the translation completion instruction is received; the translation completion file is a file after the translation of the file to be translated is completed, and the label in the file to be translated is reserved in the translation completion file.
It should be understood that, for simplicity of description, the descriptions in the first embodiment are omitted in this embodiment.
Embodiment four:
The present embodiment provides an electronic device, which may be seen in fig. 5, including a controller 501, a memory 502, and a communication bus 503. Wherein:
The communication bus 503 is used to implement connection communication between the controller 501 and the memory 502.
The controller 501 is configured to execute one or more programs stored in the memory 502 to implement the tag conversion processing method in the first/second embodiment described above.
It will be appreciated that the configuration shown in fig. 5 is merely illustrative and that the electronic device may also include more or fewer components than shown in fig. 5 or have a different configuration than shown in fig. 5, such as having also communication ports, display screens, keyboards, etc.
The present embodiment also provides a readable storage medium such as a floppy disk, an optical disk, a hard disk, a flash memory, a usb disk, an SD (Secure Digital Memory Card, secure digital Card) Card, an MMC (Multimedia Card) Card, or the like, in which one or more programs implementing the above-described steps are stored, and which can be executed by one or more controllers to implement the tag conversion processing method in the above-described first/second embodiments. And will not be described in detail herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Herein, a plurality refers to two or more.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A label switching processing method, characterized by comprising:
Identifying a target label in a file to be translated, wherein the target label is a label with a logic paired label characteristic; the label with the characteristic of the logic paired labels is in the form of independent labels in the file to be translated, but logically belongs to the independent labels of the label pair;
Judging the label type of the target label according to the label type characteristics in the logic paired label characteristics; the tag type includes a logical start tag or a logical end tag;
determining a replacement label name of the target label according to the label name of the target label;
Generating an update tag based on the tag type and the replacement tag name, such that the update tag can be identified as a formally paired tag;
Replacing the target label with the update label;
generating an update tag according to the tag type and the replacement tag name, including:
if the tag type is a logic start tag, acquiring the target tag, and replacing the tag name of the target tag with the replacement tag name to obtain the updated tag; if the tag type is a logic ending tag, acquiring the target tag, replacing the tag name of the target tag with the replacement tag name, adding an ending tag identifier before the replacement tag name, and defaulting the tag attribute of the target tag to obtain the updated tag.
2. The tag conversion processing method of claim 1, wherein identifying the target tag in the file to be translated comprises:
Acquiring a label name and/or a label attribute of a label in the file to be translated, and identifying whether the label name and/or the label attribute contains the logic paired label characteristics or not;
and if the tag name and/or the tag attribute contain the logic paired tag characteristics, determining that the tag is the target tag.
3. The tag conversion processing method according to claim 1, wherein determining the replacement tag name of the target tag based on the tag name of the target tag, comprises:
And determining a preset replacement label corresponding to the label name of the target label as the replacement label according to a preset corresponding relation.
4. The tag conversion processing method according to claim 1, characterized in that the method further comprises:
Determining the file type of the file to be translated;
And determining the logic paired tag characteristics for identifying the target tag according to the file type.
5. The tag conversion processing method according to any one of claims 1 to 4, characterized in that the method further comprises:
Judging whether the target label comprises a pairing group distinguishing attribute or not;
and if so, configuring the pairing group distinguishing attribute in the updated label according to the pairing group distinguishing attribute in the target label.
6. The tag conversion processing method according to any one of claims 1 to 4, characterized in that the method further comprises:
recording the corresponding relation between the target label and the update label;
If a translation completion instruction is received, replacing the update label with the target label in a translation completion file; the translation completion file is a file after the translation of the file to be translated is completed, and the label in the file to be translated is reserved in the translation completion file.
7. A label switching processing apparatus, comprising: the device comprises an identification module, a judging module, a determining module and a replacing module;
the identification module is used for identifying a target label in the file to be translated, wherein the target label is a label with a logic paired label characteristic; the label with the characteristic of the logic paired labels is in the form of independent labels in the file to be translated, but logically belongs to the independent labels of the label pair;
the judging module is used for judging the label type of the target label according to the label type characteristics in the logic paired label characteristics; the tag type includes a logical start tag or a logical end tag;
The determining module is used for determining a replacement label name of the target label according to the label name of the target label;
the replacing module is used for generating an updated label according to the label type and the replacing label number so that the updated label can be identified as a pair of labels in form; replacing the target label with the update label;
The replacing module is specifically configured to obtain the target tag if the tag type is a logic start tag, and replace a tag name of the target tag with the replacing tag name to obtain the updated tag; if the tag type is a logic ending tag, acquiring the target tag, replacing the tag name of the target tag with the replacement tag name, adding an ending tag identifier before the replacement tag name, and defaulting the tag attribute of the target tag to obtain the updated tag.
8. An electronic device, comprising: a controller, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the controller and the memory;
the controller is configured to execute one or more programs stored in a memory to implement the tag conversion processing method according to any one of claims 1 to 6.
9. A readable storage medium storing one or more programs executable by one or more controllers to implement the tag conversion processing method according to any one of claims 1 to 6.
CN202010867140.4A 2020-08-25 2020-08-25 Label conversion processing method and device, electronic equipment and readable storage medium Active CN111967274B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010867140.4A CN111967274B (en) 2020-08-25 2020-08-25 Label conversion processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010867140.4A CN111967274B (en) 2020-08-25 2020-08-25 Label conversion processing method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111967274A CN111967274A (en) 2020-11-20
CN111967274B true CN111967274B (en) 2024-05-31

Family

ID=73390683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010867140.4A Active CN111967274B (en) 2020-08-25 2020-08-25 Label conversion processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111967274B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632988A (en) * 2020-12-29 2021-04-09 文思海辉智科科技有限公司 Sentence segmentation method and device and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103745003A (en) * 2014-01-24 2014-04-23 北京京东尚科信息技术有限公司 HTML fragment detection method
CN107045447A (en) * 2016-02-05 2017-08-15 阿里巴巴集团控股有限公司 The tag displaying method and device of a kind of data object
CN109766560A (en) * 2019-01-14 2019-05-17 姚珍强 translation method, system, terminal and storage medium
CN109801008A (en) * 2018-06-15 2019-05-24 意盛(北京)科技有限责任公司 The method and system of authentication
CN110569332A (en) * 2019-09-09 2019-12-13 腾讯科技(深圳)有限公司 Sentence feature extraction processing method and device
CN110969003A (en) * 2018-09-29 2020-04-07 北京国双科技有限公司 Text content generation method and device
CN111143074A (en) * 2019-12-30 2020-05-12 文思海辉智科科技有限公司 Method and device for distributing translation files
CN111144070A (en) * 2019-12-31 2020-05-12 北京迈迪培尔信息技术有限公司 Document parsing translation method and device
CN111291533A (en) * 2020-01-22 2020-06-16 文思海辉智科科技有限公司 Sentence segment to be displayed display method and device, computer equipment and storage medium
CN111460835A (en) * 2020-03-31 2020-07-28 文思海辉智科科技有限公司 Auxiliary translation method and device and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2010202019B2 (en) * 2009-05-22 2015-08-20 Stanley Works Israel Ltd Object management system
WO2013086666A1 (en) * 2011-12-12 2013-06-20 Google Inc. Techniques for assisting a human translator in translating a document including at least one tag
US11386266B2 (en) * 2018-06-01 2022-07-12 Apple Inc. Text correction

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103745003A (en) * 2014-01-24 2014-04-23 北京京东尚科信息技术有限公司 HTML fragment detection method
CN107045447A (en) * 2016-02-05 2017-08-15 阿里巴巴集团控股有限公司 The tag displaying method and device of a kind of data object
CN109801008A (en) * 2018-06-15 2019-05-24 意盛(北京)科技有限责任公司 The method and system of authentication
CN110969003A (en) * 2018-09-29 2020-04-07 北京国双科技有限公司 Text content generation method and device
CN109766560A (en) * 2019-01-14 2019-05-17 姚珍强 translation method, system, terminal and storage medium
CN110569332A (en) * 2019-09-09 2019-12-13 腾讯科技(深圳)有限公司 Sentence feature extraction processing method and device
CN111143074A (en) * 2019-12-30 2020-05-12 文思海辉智科科技有限公司 Method and device for distributing translation files
CN111144070A (en) * 2019-12-31 2020-05-12 北京迈迪培尔信息技术有限公司 Document parsing translation method and device
CN111291533A (en) * 2020-01-22 2020-06-16 文思海辉智科科技有限公司 Sentence segment to be displayed display method and device, computer equipment and storage medium
CN111460835A (en) * 2020-03-31 2020-07-28 文思海辉智科科技有限公司 Auxiliary translation method and device and electronic equipment

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
An Information-Theoretic Approach to the Chipless RFID Tag Identification;Yanling Chen等;IEEE;第7卷;第96984页-97000页 *
一种用于Java程序验证编译的标签类型;陈晖, 陈意云, 茹祥民;软件学报;第16卷(第03期);第346页-354页 *
基于动态标签技术的信息发布***设计研究;姚军;电子设计工程;第27卷(第15期);第21页-30页 *
数据抽取中数据预处理;郭东峰;数据库技术(第7期);第224页 *
电子书包在线作业***的设计研究;王峥嵘;中国优秀硕士学位论文全文数据库信息科技辑(第1期);第I138-276页 *

Also Published As

Publication number Publication date
CN111967274A (en) 2020-11-20

Similar Documents

Publication Publication Date Title
CN109086199B (en) Method, terminal and storage medium for automatically generating test script
CN110705299A (en) Entity and relation combined extraction method, model, electronic equipment and storage medium
CN110825431B (en) Interface document processing method, device, system, storage medium and electronic equipment
CN109408247A (en) Interaction data processing method and device
CN107566090B (en) Fixed-length/variable-length text message processing method and device
CN103761095B (en) Method for generating universal upgrade file head data information
CN111967274B (en) Label conversion processing method and device, electronic equipment and readable storage medium
CN110837727A (en) Document template generation method and device, terminal equipment and medium
CN114218370A (en) Method, device, equipment and storage medium for determining answers to questions reported by single disease
CN105389180B (en) A kind of USB port configurableization method based on Android platform
CN110633258B (en) Log insertion method, device, computer device and storage medium
CN103246605A (en) Method and system for collocating remote controller key values based on xml (extensive markup language)
CN110347379B (en) Processing method, device and storage medium for combined crowdsourcing questions
CN111241096A (en) Text extraction method, system, terminal and storage medium for EXCEL document
CN111026604A (en) Log file analysis method and device
CN115080444A (en) Test case conversion method and device, electronic equipment and storage medium
CN110489121B (en) Skin package file generation method and system
CN107612919B (en) Protocol configuration method and device
CN113297425A (en) Document conversion method, device, server and storage medium
CN104503992A (en) Question bank construction method
CN110457659B (en) Clause document generation method and terminal equipment
WO2024055862A1 (en) Document review method and apparatus for implementing ia by combining rpa and ai, and electronic device
CN117234944B (en) Automatic interface testing method based on pytest
CN110955687B (en) Data modification method and device
CN112948266B (en) Database grammar testing system, method, device, equipment and storage medium

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