Text information processing method and device, equipment and storage medium
By obtaining and processing data instances and information components of text controls, automatically comparing translated text, solving the problem of manual inspection of translation efficiency in the prior art, and achieving efficient translation detection.
Patent Information
- Application Number
- CN202311361920.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-19
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, when the application supports multiple languages, it is necessary to manually check the interface to avoid omissions in the translation process, which is inefficient.
By obtaining data instances of text controls, setting information components to describe control properties, and comparing translated text and information components to generate translation detection results to improve translation verification efficiency.
Automatic text control translation detection is realized, avoiding the inefficiency problem of manual inspection and improving the efficiency of the translation process.
Smart Images

Figure CN119862893A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a text information processing method, device, equipment and storage medium. Background Art
[0002] As applications evolve, more and more applications are able to support multiple languages.
[0003] In the related art, the application supports multiple languages by translating text. Since there are many places in the application where text needs to be displayed, the interface of the application needs to be checked manually to avoid problems such as omissions in the translation process.
[0004] However, the above manual inspection process is relatively inefficient. Summary of the invention
[0005] The present application provides a text information processing method, device, equipment and storage medium, and the technical solution is as follows:
[0006] According to one aspect of the present application, a method for processing text information is provided, the method comprising:
[0007] Acquire a data instance corresponding to a text control, wherein the data instance is stored in a data structure, and the data instance carries a control identifier of the text control and original text information carried by the text control;
[0008] According to the data instance, an information component mounted on the text control is set, wherein the information component is used to describe the attribute information of the text control;
[0009] The translated text of the text control is obtained, and the translation detection result of the text control is obtained by comparing the information component with the translated text.
[0010] According to another aspect of the present application, a text information processing device is provided, the device comprising:
[0011] An acquisition module, used for acquiring a data instance corresponding to a text control, wherein the data instance is stored in a data structure, and the data instance carries a control identifier of the text control and original text information carried by the text control;
[0012] A processing module, used for setting an information component mounted on the text control according to the data instance, wherein the information component is used for describing the attribute information of the text control;
[0013] The processing module is further used to obtain the translated text of the text control, and obtain the translation detection result of the text control by comparing the information component with the translated text.
[0014] In an optional design of the present application, the information component is a component using a key-value pair structure; and the processing module is further used for:
[0015] Determine the control identifier carried in the data instance as a keyword of the information component, determine the original text information carried in the data instance as a value of the information component, and set the information component;
[0016] The information component is a subcomponent mounted on the text control.
[0017] In an optional design of the present application, the processing module is further used for:
[0018] Determine the control identifier carried in the data instance as a keyword of a first component, determine the original text information carried in the data instance as a value of the first component, and construct the first component;
[0019] The first component is mounted on the text control and determined as the information component.
[0020] In an optional design of the present application, the acquisition module is further used for:
[0021] Obtaining a memory page size of a memory space corresponding to the data structure;
[0022] Determining a starting memory page and an ending memory page of the data structure according to the memory page size and the memory address of the data structure;
[0023] The processing module is also used for:
[0024] The control identifier stored in the starting memory page to the ending memory page is determined as the keyword of the information component, the original text information stored in the starting memory page to the ending memory page is determined as the value of the information component, and the information component is set.
[0025] In an optional design of the present application, the processing module is further used for at least one of the following:
[0026] In the case where the translation text and the information component have the same value, the translation detection result of the text control is a first label, and the first label is used to indicate that a translation omission occurs in the translation process of the text control;
[0027] In the case where the keywords of the translation text and the information component are the same, the translation detection result of the text control is a second label, and the second label is used to indicate that a mapping relationship between the translation text and the control identifier is missing during the translation process of the text control;
[0028] In the case that the translation text and the value of the information component are in different languages, the translation detection result of the text control is a third label, and the third label is used to indicate that the translation process for the text control is completed.
[0029] In an optional design of the present application, the acquisition module is further used for:
[0030] Obtaining the control identifier and the original text information of the text control;
[0031] The control identifier and the original text information are concatenated to obtain a first string, the first string is searched for in data identifiers of multiple candidate data structures to obtain the data instance, and the data identifier of the data structure used to store the data instance is the first string.
[0032] In an optional design of the present application, the acquisition module is further used for:
[0033] Obtaining the control identifier of the text control, where the control identifier is a hash value of the original text information;
[0034] Based on the mapping relationship between the original text information and the control identifier, the original text information is searched and obtained according to the control identifier.
[0035] In an optional design of the present application, the acquisition module is further used for:
[0036] Acquire index information of the text control, where the index information is used to indicate at least one level upper node to which the text control belongs;
[0037] The first character string is obtained by concatenating the control identifier, the original text information and the index information.
[0038] In an optional design of the present application, the acquisition module is further used for:
[0039] Obtain at least two levels of upper nodes to which the text control belongs;
[0040] Arrange the at least two levels of upper nodes in order of belonging relationship to obtain the index information of the text control.
[0041] In an optional design of the present application, the data instance is used to store a key-value pair, and the key-value pair includes a keyword of the data instance and a value of the data instance;
[0042] The processing module is also used for:
[0043] The data instance stored in the data structure is constructed based on the control identifier and the original text information; the control identifier corresponds to a keyword of the data instance, and the original text information corresponds to a value of the data instance.
[0044] In an optional design of the present application, when the original text information includes web page identification text, storage path text, the original text information is empty, or the original text information consists of numbers, the data structure corresponding to the text control is empty, and the data structure is empty to indicate that the text control does not need to compare the information component and the translated text of the text control.
[0045] According to another aspect of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the text information processing method as described above.
[0046] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the text information processing method described above.
[0047] According to another aspect of the present application, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the text information processing method described above.
[0048] The beneficial effects of the technical solution provided by this application include at least:
[0049] By acquiring the data instance stored in the form of a data structure, the data instance of the text control in the application is obtained, avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; the information component is mounted on the text control, and the control identifier and original text information carried in the data instance of the text control are recorded in the form of a mounted component, which can realize the comparison between the information component and the translated text; and the efficiency of checking the translation of the text control is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0051] Figure 1 is a schematic diagram of a computer system provided by an exemplary embodiment of the present application;
[0052] Figure 2 is a schematic diagram of a text information processing method provided by an exemplary embodiment of the present application;
[0053] Figure 3 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0054] Figure 4 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0055] Figure 5 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0056] Figure 6 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0057] Figure 7 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0058] Figure 8 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0059] Fig. 9 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0060] Fig.10 is a flowchart of a method for processing text information provided by an exemplary embodiment of the present application;
[0061] Fig.11 is a schematic diagram of a text control provided by an exemplary embodiment of the present application;
[0062] Fig.12 is a schematic diagram of a text control provided by an exemplary embodiment of the present application;
[0063] Fig.13 is a structural block diagram of a text information processing device provided by an exemplary embodiment of the present application;
[0064] Fig.14 It is a structural block diagram of a server provided by an exemplary embodiment of the present application.
[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION
[0066] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0067] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0068] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0069] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the text controls, control identifiers of text controls and other information involved in this application are all obtained with full authorization.
[0070] It should be understood that although the terms first, second, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0071] Figure 1 A schematic diagram of a computer system provided by an embodiment of the present application is shown. The computer system can be implemented as a system architecture of a text information processing method. The computer system may include: a terminal 100 and a server 200.
[0072] The terminal 100 may be an electronic device such as a mobile phone, a tablet computer, a vehicle-mounted terminal (vehicle computer), a wearable device, a PC (Personal Computer), etc. The terminal 100 may be installed with a client that runs a target application, and the target application may be a text information processing application or other application that provides a text information processing function, which is not limited in this application. In addition, this application does not limit the form of the target application, including but not limited to App (Application) installed in the terminal 100, applets, etc., and may also be in the form of a web page.
[0073] The server 200 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The server 200 may be a background server of the target application, used to provide background services for the client of the target application.
[0074] The text information processing method provided in the embodiment of the present application can be performed by a computer device, which refers to an electronic device with data calculation, processing and storage capabilities. Figure 1 Taking the implementation environment of the scheme shown as an example, the text information processing method can be executed by the terminal 100 (such as the client of the target application installed and running in the terminal 100 executes the text information processing method), or the text information processing method can be executed by the server 200, or the terminal 100 and the server 200 can interact and cooperate to execute it, and this application does not limit this.
[0075] In addition, the technical solution of the present application can be combined with blockchain technology. For example, in the text information processing method disclosed in the present application, some data involved (such as the direction information of the first road and the second road) can be stored on the blockchain. The terminal 100 and the server 200 can communicate through a network, such as a wired or wireless network.
[0076] Next, the text information processing method in this application is introduced:
[0077] Figure 2 A schematic diagram of a method for processing text information provided by an embodiment of the present application is shown.
[0078] Exemplarily, a text control of an application is displayed on the first interface 300. Taking the first text control 302 as an example, the first text control 302 is a function entry of the battle preparation function. Exemplarily, a text control in an application can be a function entry or a control used only to display text information.
[0079] Exemplarily, the control identifier 312 of the first text control is obtained, and the control identifier 312 is information obtained by encrypting the original text information 314 using the MD5 message digest algorithm (Message-Digest Algorithm, MD5); there is a mapping relationship between the original text information 314 and the control identifier 312, and the original text information 314 corresponding to the control identifier 312 is obtained according to the mapping relationship.
[0080] Exemplarily, the node attribution information 305 of the first text control 302 is used to indicate at least one upper node of the container corresponding to the first text control. Specifically, the first text control corresponds to the first container 306, and the container name of the first container 306 is Container2; the upper nodes include Container0 and Container1; the above upper nodes are arranged in order of attribution to obtain the index information 316 of the first text control 302; the index information 316 is Container0 / Container1 / Container2.
[0081] Exemplarily, the control identifier 312, the original text information 314 and the index information 316 are concatenated to obtain a first string 321, in which there is a separator "$$" between the control identifier 312, the original text information 314 and the index information 316. A separator is added after the control identifier 312, and then the original text information 314 is concatenated; a separator is added after the original text information 314, and then the index information 316 is concatenated to obtain the first string 321; the first string 321 is determined as the data identifier 352 of the data structure 350; the data structure 350 is found based on the data identifier 352. Exemplarily, the second string 322 is used to indicate that the control identifier 312 corresponds to the instance keyword 354a of the data instance 354, and the original text information 314 corresponds to the instance value 354b of the data instance 354. For example, the data instance 354 stored in the data structure 350 is:
[0082] {"InstanceIndex":0,
[0083] "Key":"Hero_Prop_MgcAtkPt",
[0084] "Value":"Spell Attack"}
[0085] Among them, "Hero_Prop_MgcAtkPt" is the control identifier 312, "Spell Attack" is the original text information 314; "0" is the index information of the data instance 354, which is usually preset.
[0086] According to the data structure 350, an information component 360 mounted on the first text control 302 is added, and the information component 360 is used to describe the attribute information of the first text control 302; specifically, the control identifier 312 carried by the instance keyword 354a in the data instance 354 stored in the data structure 350 is determined as the component keyword 360a of the information component 360, and the original text information 314 carried by the instance value 354b in the data instance 354 stored in the data structure 350 is determined as the component value 360b of the information component 360, and the information component 360 is constructed; the information component 360 is mounted on the first text control 302.
[0087] The translated text 365 of the first text control 302 is obtained, and the translation detection result 370 of the first text control 302 is obtained based on the comparison of the information component 360 and the translated text 365. Exemplarily, the translated text 365 is obtained based on the information component 360 searching the original text information 314 of the first text control 302 according to the translation configuration data. The translation detection result 370 is used to indicate whether the original text information 314 of the first text control 302 is correctly translated. For example, when the component value 360b of the information component 360 and the translated text 365 are in different languages, the translation detection result 370 is used to indicate that the translation process for the first text control 302 is completed, and the text information of the first text control 302 is correctly translated.
[0088] Figure 3 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. The method includes:
[0089] Step 510: Obtain the data instance corresponding to the text control;
[0090] Exemplarily, the text control is a function entry in the application, or it can be a control that is only used to display text information. Exemplarily, the text control corresponds to a data instance, and the data instance is used to carry the control identifier of the text control and the original text information carried by the text control. The data instance of the text control is stored in the form of a data structure. Exemplarily, the data structure can be at least one of an array, a linked list, a stack, a queue, a key-value pair, etc. Taking the data structure as a global mapping (Map) structure as an example, the data instance is a value (Value) in the global mapping structure. Exemplarily, the data instance is an instance information of a text control stored in the memory space.
[0091] Step 520: according to the data instance, set the information component mounted on the text control;
[0092] Exemplarily, the information component is used to describe the attribute information of the text control; the information carried by the information component is determined according to the data instance. By setting the information component, the control identifier and original text information of the text control are mounted on the text control in a component manner, avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process.
[0093] Exemplarily, the information component can be a subcomponent mounted on the text control, or it can be a newly created component based on the data instance; this application is not limited to this. Exemplarily, the information component can carry information in at least one of an array, a linked list, a stack, a queue, a key-value pair, etc., and carry the attribute information of the text control on the information component. Exemplarily, the attribute information of the text control is mounted on the text information in a component manner, and the control data of the text control, such as the control identifier and original text information of the text control, can be obtained from the information component corresponding to the text control.
[0094] This embodiment obtains the data instance corresponding to the text control and sets the information component mounted on the text control; it inherits and rewrites the attribute information of the text control in a hook manner, thereby mounting the attribute information of the text control on the subcomponent of the text control, and realizes the acquisition and setting of the attribute information of the text control at the assembly level, thereby realizing the mounting of the attribute information without modifying the text control itself.
[0095] Step 530: Obtain the translation text of the text control, and obtain the translation detection result of the text control according to the comparison information component and the translation text;
[0096] Exemplarily, the information component carries the control identifier of the text control and the original text information; the translated text is the translation information corresponding to the original text information, and the translated text and the original text information are in different languages. Exemplarily, the translated text can be obtained by translating the original text information after obtaining the original text information, or it can be obtained by translating the display text corresponding to the text control on the interface of the application. In one example, the display text and the original text information in the text control on the interface of the application can be in the same or different languages, and the application does not impose any restrictions on this.
[0097] Exemplarily, the translation detection result is used to indicate whether the translated text correctly translates the text corresponding to the text control. The translation detection result will be further described below through specific embodiments.
[0098] In summary, the method provided in this embodiment obtains the data instance of the text control in the application by obtaining the data instance stored in the form of a data structure, thereby avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; the information component is mounted on the text control, and the control identifier and original text information carried in the data instance of the text control are recorded in the form of a mounted component, which can realize the comparison between the information component and the translated text; and the efficiency of checking the translation of the text control is improved.
[0099] Figure 4A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 3 In the illustrated embodiment, step 520 may be implemented as step 522:
[0100] Step 522: determine the control identifier carried in the data instance as the keyword of the information component, determine the original text information carried in the data instance as the value of the information component, and set the information component;
[0101] Exemplarily, the information component is a subcomponent mounted on the text control. In this embodiment, the information component is a component using a key-value pair structure, and the information component carries the attribute information of the text control in the form of a key-value pair. Exemplarily, the control identifier carried in the data instance is determined as the keyword (Key, also called key) of the information component, and the original text information carried in the data instance is determined as the value (Value, also called value) of the information component; the information component is set.
[0102] In one example, the information component is a text extra data component mounted on a text control. By determining the control identifier as the keyword of the information component and the original text information as the value of the information component, the attribute information of the text control is dynamically mounted on the information component in the form of a key-value pair, avoiding modification of the type of the text control; the attribute information can be mounted when the text component of the native Unity engine is used during the development process.
[0103] In an optional implementation, the information component is a component newly created according to the data instance. Specifically, step 522 in this embodiment can be implemented as follows:
[0104] Determine the control identifier carried in the data instance as the keyword of the first component, determine the original text information carried in the data instance as the value of the first component, and construct the first component;
[0105] The first component is mounted on the text control and is determined as an information component.
[0106] Exemplarily, the first component is a newly created component based on the data instance, the control identifier carried in the data instance is determined as the keyword of the first component, and the original text information carried in the data instance is determined as the value of the first component. It can be seen that the key-value pair carried by the first component indicates the attribute information of the text control; by mounting the first component on the text control, the attribute information of the text control is mounted on the text information in a component manner.
[0107] Exemplarily, mounting the first component on a text control is used to indicate that the first component is determined as a subcomponent of the text control; Exemplarily, a text control refers to a graphical user interface (GUI) element used to input or display text in an application interface, such as a text box, label, or text area. A subcomponent refers to an auxiliary component added to a text control to extend the functionality of the text control or provide additional information. Exemplarily, mounting the first component on a text component is used to indicate that the container corresponding to the first component belongs to the container corresponding to the text control.
[0108] To summarize, the method provided in this embodiment obtains the data instance of the text control in the application by obtaining the data instance stored in the form of a data structure, thereby avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; the information component is mounted on the text control, and the information component records the control identifier and original text information of the text control in the form of a key-value pair, thereby realizing the recording of the control identifier and original text information carried in the data instance of the text control in the form of a mounted component, and enabling the information component to be compared with the translated text; thus improving the efficiency of checking the translation of the text control.
[0109] In an optional implementation of the present application, Figure 4 On the basis of the illustrated embodiment, sub-steps 20 and 21 are further included before step 522; step 522 can be implemented as sub-step 22:
[0110] Sub-step 20: Obtain the memory page size of the memory space corresponding to the data structure;
[0111] Exemplarily, the memory page size is a fixed-size data block in the memory management process. Specifically, the memory page size is used to indicate the size information of the fixed-size data block in the memory space corresponding to the data structure. Exemplarily, the memory page size is determined by the operating system; the memory page sizes of different types of operating systems, or the same type but different versions of operating systems can be different or the same.
[0112] Taking the Android operating system as an example, for Android version 4, the Java class of the Android operating system is instantiated through the UnityPlayer class of the Unity engine, and the activity manager of the Android operating system is instantiated through the Java class to obtain the memory page size.
[0113] For Android 4.4, the manager object is instantiated through the native activity manager to obtain the memory page size.
[0114] For Android 2 version, the attribute class instance of the Android operating system is obtained through the Java system class, and the memory page size of the virtual machine parameter of the Android operating system is obtained through the attribute class instance.
[0115] Sub-step 21: determining a starting memory page and an ending memory page of the data structure according to the memory page size and the memory address of the data structure;
[0116] Exemplarily, the memory address of the data structure is used to indicate the storage address of the memory space used to store the data instance, and the starting memory page and the ending memory page where the data structure is located are obtained according to the memory page size and the memory address of the data structure; wherein the memory page size is used to indicate the storage information of each memory page.
[0117] Sub-step 22: Determine the control identifier stored in the starting memory page to the ending memory page as the keyword of the information component, determine the original text information stored in the starting memory page to the ending memory page as the value of the information component, and set the information component.
[0118] Exemplarily, the storage location of the control identifier and the original text information of the information component is set in the range from the starting memory page to the ending memory page, and the control identifier and the original text information are obtained in the range from the starting memory page to the ending memory page.
[0119] In summary, the method provided in this embodiment determines the range of memory pages storing control identifiers and original text information by obtaining the memory page size of the memory space, obtains the control identifier and original text information from the starting memory page to the ending memory page, narrows the scope of information acquisition, and improves information processing efficiency; obtains a data instance stored in a data structure, obtains a data instance of the text control in the application, and avoids the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; mounts the information component on the text control, and realizes the recording of the control identifier and original text information carried in the data instance of the text control in the form of a mounted component, which can realize the comparison of the information component with the translated text; and improves the efficiency of checking the translation of the text control.
[0120] Next, the acquisition of data instances will be introduced through the following embodiments.
[0121] Figure 5 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 3 In the illustrated embodiment, step 510 may be implemented as steps 512 and 514:
[0122] Step 512: Obtain the control identifier and original text information of the text control;
[0123] Exemplarily, the control identifier and original text information of a text control are attribute information of the text control; in one example, the control identifier and original text information of a text control are obtained based on the setting information when the text control is developed. Exemplarily, the control identifier is the unique index information of the text control, for example, the control identifier is the keyword (Key) of the text control. Exemplarily, the original text information of a text control is the original text determined during the development process of the text control. The original text information can be directly displayed on the interface of the application, or the translated text obtained by translating the original text information can be displayed. This application does not limit the language of the text displayed on the application.
[0124] In an optional implementation of the present application, step 512 may be implemented as the following two sub-steps:
[0125] Sub-step 12a: Obtain the control identifier of the text control;
[0126] Sub-step 12b: based on the mapping relationship between the original text information and the control identifier, searching for the original text information according to the control identifier;
[0127] Exemplarily, the control identifier is a hash value obtained by encrypting the original text information using a hash function algorithm, that is, the control identifier is the hash value of the original text information; exemplary, the hash value algorithm includes but is not limited to: at least one of: Message Digest Algorithm 2 (MD2), Message Digest Algorithm 4 (MD4), Message Digest Algorithm 5 (MD5), Secure Hash Algorithm 1 (SHA1), and Secure Hash Algorithm 256-bit (SHA256).
[0128] Exemplarily, the mapping relationship between the original text information and the control identifier is used to indicate the original text information corresponding to the control identifier one by one, and based on the mapping relationship, the original text information is found according to the control identifier. Exemplarily, the original text information is the text information written in the text control development process, and the mapping relationship indicates the original text information. The original text information can be directly carried in the mapping relationship, or the storage location of the original text information can be indicated based on the mapping relationship.
[0129] Step 514: concatenate the control identifier and the original text information to obtain a first string, search for the first string in data identifiers of multiple candidate data structures, and obtain a data instance;
[0130] Exemplarily, the first string includes a control identifier and original text information. This embodiment does not limit the order of the control identifier and the original text information in the first string. In one implementation, there is a separator character between the control identifier and the original text information. Specifically, the first string is "control identifier $$ original text information", where "$$" is a separator character.
[0131] Exemplarily, the data identifier of the data structure for storing the data instance is a first string. By searching for the first string in the data identifiers of multiple candidate data structures, a data structure with the data identifier as the first string is obtained, and the data structure stores the data instance.
[0132] In summary, the method provided in this embodiment searches for a first string obtained by concatenating a control identifier and original text information, and searches for a data structure storing a data instance in multiple candidate data structures; obtains the data instance stored in the form of a data structure, that is, obtains the data instance of the text control in the application, thereby avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process. In the scenario of application development, the processing efficiency of translating text controls in the application is improved. The text controls used in the application development process can realize flexible mounting components to carry the control identifier and original text information of the text control, without the need to redesign the type of the text control, thereby avoiding the manual marking of the control identifier and original text information of the text control in the related art, and improving the efficiency of translating characters in the text control when the application has multi-language requirements; the information component is mounted on the text control, thereby realizing the recording of the control identifier and original text information carried in the data instance of the text control in the form of a mounted component, and enabling the information component to be compared with the translated text; and improving the efficiency of checking the translation of the text control.
[0133] Figure 6 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device, and the method includes:
[0134] Step 702: Obtain a control identifier, original text information, and index information, and concatenate them to obtain a first string;
[0135] Exemplarily, the control identifier and the original text information are used to indicate the attribute information of the text control, indicating the text semantics carried by the text control and the corresponding hash value. The index information indicates the upper node of the container corresponding to the text control, ensuring the global uniqueness of the first string in the application.
[0136] Step 704: searching for a first character string in data identifiers of multiple candidate data structures to obtain a data instance;
[0137] Exemplarily, the data structure to which the data instance belongs is a key-value pair; wherein the key of the data structure is a data identifier; by searching for a first string in the data identifiers of multiple candidate data structures, a data structure storing the data instance is obtained, and the value of the data structure is the data instance. Exemplarily, the data structure is a global mapping structure, and the data instance in the global mapping structure is obtained by unique value data mapping.
[0138] Step 706: Obtain the information component mounted on the text control;
[0139] Exemplarily, the information component is a subcomponent mounted on the text control, and the information component is used to indicate the attribute information on the text control, and the data instance stored in the data structure is mounted on the text control in a component manner.
[0140] Exemplarily, the information component can be an empty component mounted on the text control during the text control development process, or it can be a newly created component; exemplarily, if the information component is a newly created component, the information component needs to be initialized to ensure that it is mounted on the text control.
[0141] Step 708: assigning values to information components according to the values of the data instances;
[0142] Exemplarily, the data instance records the control identifier and original text information of the text control, and the control identifier and original text information of the text control recorded in the data instance are assigned to the information component to implement the setting of the information component. Exemplarily, the information component is a text extra data component mounted on the text control.
[0143] By mounting the information component on the text control, it is possible to dynamically mount the attribute information of the text control, such as the control identifier of the text control, the original text information, and other information, on the text additional data component without affecting the function of the text control; so as to facilitate language quality assurance (Linguistic Quality Assurance, LQA) through the text control and the information component, and to detect the translation information of the original text information.
[0144] In summary, the method provided in this embodiment obtains a data instance stored in a data structure, avoiding the problem of being unable to obtain the control identifier and original text information of the text control during the assembly process. In the scenario of application development, the processing efficiency of translating text controls in the application is improved, and there is no need to redesign the type of text control. This avoids the manual annotation of the control identifier and original text information of the text control in the related technology, and improves the efficiency of translating characters in the text control when the application has multi-language requirements; assigns values to information components according to the values of the data instance, and realizes the recording of the control identifier and original text information carried in the data instance of the text control in the form of a mounted component, which can realize the comparison between the information component and the translated text; and improves the efficiency of checking the translation of the text control.
[0145] Figure 7 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 5 Based on the illustrated embodiment, step 505 is also included:
[0146] Step 505: Obtain index information of the text control;
[0147] Exemplarily, the index information is used to indicate at least one level of upper nodes to which the text control belongs; the upper node is the upper node to which the container corresponding to the text control belongs. Exemplarily, the number of upper nodes indicated by the index information can be one level of upper nodes or multiple levels of upper nodes.
[0148] Accordingly, in this embodiment, the first string is obtained by concatenating the control identifier, the original text information, and the index information. This embodiment does not limit the order of the control identifier, the original text information, and the index information in the first string. Specifically, the first string is "control identifier $$ original text information $$ index information"; where "$$" is a separator character.
[0149] Exemplarily, by obtaining index information and carrying the index information in the first character string, the uniqueness of the data identifier corresponding to the data structure is guaranteed, avoiding the impact of reuse of text controls; and the uniqueness of the data identifier corresponding to the data structure is guaranteed when there are many interfaces in the application and the display content of the text controls in different interfaces is exactly the same.
[0150] Exemplarily, when the index information indicates that there are multiple levels of upper nodes, the index information is obtained by sorting the multiple levels of upper nodes. In an optional implementation of this embodiment, step 505 can be implemented as the following two sub-steps:
[0151] Sub-step 5a: Obtain at least two levels of upper nodes to which the text control belongs;
[0152] Sub-step 5b: Arrange at least two levels of upper-level nodes in order of ownership to obtain index information of the text control.
[0153] Exemplarily, since there are many text controls that need to be used in the application, and the contents of some text controls on different pages can be the same, when the text controls are reused, the first string includes index information, that is, the data identifier of the data structure includes index information, which ensures the global uniqueness of the data structure in the application. In one example, at least two levels of upper nodes include the node name of the interface corresponding to the text control in the application.
[0154] Exemplarily, the i-th level upper node belongs to the i+1-th level upper node, i is a positive integer; specifically, the at least two levels of upper nodes include the n-th level upper node. Arranging the at least two levels of upper nodes in the order of belonging is used to indicate arranging the n-th level upper node to the i-th level upper node in order to obtain the index information of the text control.
[0155] In a specific example, the name of the container corresponding to the text control is Container2, the parent node name of the container corresponding to the text control is Container1, and the node with the node name Container1 is at least the first-level upper node to which the text control belongs. The parent node name of the node with the node name Container1 is Container0, which is also called the grandfather node of the node corresponding to the text control, or the grandfather node, and the node with the node name Container0 is at least the second-level upper node to which the text control belongs.
[0156] Exemplarily, the second-level upper nodes and the first-level upper nodes are arranged in sequence to obtain the index information of the text control. It is understandable that the index information may also include the container name corresponding to the text control, so as to distinguish the text controls belonging to the same node on the same interface in the index information. In a specific example, the index information of the text control above is Container0 / Container1 / Container2. It can be seen that when at least two levels of upper nodes are arranged in order of belonging, there is a separator symbol " / ". It is understandable that the separator symbol may also be other characters, and this application does not limit it.
[0157] To summarize, the method provided in this embodiment obtains index information, and the first character string includes the index information, thereby ensuring the uniqueness of the data identifier corresponding to the data structure; by searching and splicing the first character string, the data structure storing the data instance is found in multiple candidate data structures; the data instance stored in the form of a data structure is obtained, that is, the data instance of the text control in the application is obtained, thereby avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; the information component is mounted on the text control, thereby realizing the recording of the control identifier and original text information carried in the data instance of the text control in the form of a mounted component.
[0158] Figure 8 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 5 Based on the illustrated embodiment, step 502 is also included:
[0159] Step 502: constructing a data instance stored in a data structure based on the control identifier and the original text information;
[0160] Exemplarily, this embodiment introduces a method for constructing a data instance in a data structure; it can be understood that the data instance is constructed before searching for the first character string to obtain the data instance.
[0161] Exemplarily, a data instance is used to store a key-value pair, which includes a keyword of the data instance and a value of the data instance; by constructing a data instance, the setting information of the text control during the development process is stored in the memory space in the form of a data structure; through step 520 in this embodiment, the setting information of the text control during the development process is mounted on the text control in the form of a component, thereby obtaining the control identifier and original text information of the text control when displaying the interface of the application.
[0162] Exemplarily, the control identifier corresponds to the keyword of the data instance, and the original text information corresponds to the value of the data instance. The keywords and values in the data instance are all strings, and the prompt text in the data instance indicates that the keywords and values in the data instance are all strings. In one example, the data instance includes the string "Key":"Hero_Prop_MgcAtkPt", "Value":"Magic Attack". Among them, Hero_Prop_MgcAtkPt is the control identifier, Key is the prompt text of the control identifier, and the control identifier is determined as the keyword of the data instance. Magic attack is the original text information, Value is the prompt text of the control identifier, and the original text information is determined as the value of the data instance. In one implementation, the data instance also includes an instance index for indicating the index information of the data instance. The index information of the data instance can be pre-set, such as the serial number of the created data instance, such as: "InstanceIndex":0. Among them, InstanceIndex is the prompt text of the index information of the data instance, and 0 is the index information of the data instance.
[0163] In the above example, the string stored in the data instance is:
[0164] {"InstanceIndex":0,
[0165] "Key":"Hero_Prop_MgcAtkPt",
[0166] "Value":"Spell Attack"}
[0167] The specific meaning of each character in the data instance has been introduced above.
[0168] In an optional implementation of the present application, when the original text information includes web page identification text, storage path text, the original text information is empty, or the original text information consists of numbers, the data structure corresponding to the text control is empty;
[0169] Exemplarily, the data structure corresponding to the text control is empty to indicate that there is no data structure corresponding to the text control, and there is no text control data instance. Exemplarily, the data structure is empty to indicate that the text control does not need to compare the information component and the translated text of the text control.
[0170] In the case where the original text information includes a web page logo text, the content filled in the text control is image information, such as a web page logo that starts with an http symbol and is a link to an image resource provided by a content distribution network (such as a CDN), which is used to indicate a Uniform Resource Locator (URL) of the image resource. In the process of translating the text on the application interface, it is not necessary to translate the image information.
[0171] In the case where the original text information includes storage path text, the content filled in the text control is the information resources in the storage space. The information resources indicated by the storage path text do not need to be translated and are displayed in the same style in display interfaces of different languages.
[0172] When the original text information is empty, the text control is only used to hold a placeholder or reserve a text display position required in the subsequent development process. There is no corresponding original text information, and there is no need to translate the text of the comparison information component and the text control.
[0173] When the original text information consists of numbers, the text control only displays numbers, and there is no need to translate the pure digital content on the display interface in different languages, so as to reduce the complexity of translating the information on the application interface.
[0174] In summary, the method provided in this embodiment constructs a data instance through the control identifier and original text information of the text control, and stores the setting information of the text control during the development process in the memory space in the form of a data structure; obtains the data instance stored in the form of a data structure, and obtains the data instance of the text control in the application, avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; mounts the information component on the text control, and realizes the recording of the control identifier and original text information carried in the data instance of the text control in the form of a mounted component, which can realize the comparison of the information component with the translated text; improves the efficiency of checking the translation of the text control.
[0175] Fig. 9 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device, and the method includes:
[0176] Step 722: Get the control identifier of the text control;
[0177] Exemplarily, the control identifier is a hash value obtained by encrypting the original text information using a hash value algorithm. In this embodiment, the control identifier is a hash value obtained by encrypting the original text information using a message digest algorithm 5 algorithm.
[0178] Step 724: Obtain the original text information of the text control according to the mapping relationship between the control identifier and the original text information;
[0179] Exemplarily, the mapping relationship between the control identifier and the original text information is used to indicate a one-to-one correspondence between the hash value obtained from the secret and the text characters, and the control identifier is searched in the mapping relationship to obtain the original text information corresponding to the text control.
[0180] Step 726: Get the index information of the text control;
[0181] Exemplarily, the index information is used to indicate at least one level of upper node to which the text control belongs; the upper node is the upper node to which the container corresponding to the text control belongs. The index information avoids the impact of the same control identifier of the text control caused by the reuse of the text control. For an introduction to the upper node, please refer to the above Figure 7 The corresponding embodiments.
[0182] Step 728: Obtain a key information string according to the control identifier, the original text information and the index information;
[0183] For example, the data instance stored in the data structure is obtained based on the key information string. For an introduction to the data instance, please refer to the above Figure 8 Corresponding embodiments: A data instance is a key-value pair, and the keyword and value of the data instance are both constructed based on the key information string.
[0184] To sum up, the method provided in this embodiment obtains the control identifier, original text information and index information of the text control, and splices the above information to obtain a key information string. The data instance stored in the data structure is obtained based on the key information string, avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process.
[0185] Fig.10 A flowchart of a text information processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 In the illustrated embodiment, step 530 may be implemented as at least one of the following:
[0186] Step 532: When the values of the translated text and the information component are the same, the translation detection result of the text control is the first label;
[0187] Exemplarily, when the values of the translated text and the information component are the same, the translation process of the text control fails; specifically, the value of the information component corresponds to the original text information of the text control; the translated text and the original text information of the text control are the same, the translation process does not correctly translate the original text information, and a translation omission occurs in the text control, and the first label is used to indicate that a translation omission occurs in the translation process of the text control.
[0188] In an example, a text control includes a control identifier, and the translated text is obtained by finding the mapping relationship between the control identifier of the text control and the translated text; the situation where the translated text and the information component have the same value is because the control identifier of the text control is not found and the original text information is still displayed, which is also called key value omission, such as omitting to mount the control identifier of the text control on the text control.
[0189] Step 534: When the keywords of the translated text and the information component are the same, the translation detection result of the text control is the second label;
[0190] Exemplarily, when the keywords of the translated text and the information component are the same, the translation process of the text control fails; specifically, the keywords of the information component correspond to the control identifier of the text control; the keywords of the translated text and the information component are the same, the translation process does not correctly translate the original text information, and there is a problem of missing mapping relationship for the text control. Specifically, the second label is used to indicate that there is a missing mapping relationship between the translated text and the control identifier in the translation process for the text control.
[0191] In one example, a text control includes a control identifier, the control identifier is obtained on the information component on which the text control is mounted, and the translated text is obtained by finding a mapping relationship between the control identifier of the text control and the translated text; due to the missing mapping relationship between the translated text and the control identifier, the translated text of the text control cannot be determined, and only the control identifier of the text control can be displayed during the translation process, i.e., the translated text and the information component have the same keywords.
[0192] Fig.11A schematic diagram of a text control provided by an exemplary embodiment of the present application is shown. A display interface of the second interface 420 program is an interface displayed in English after translation. In the second interface 420, the fourth text control 421 is used to indicate that the name of the virtual skill of the virtual character is Holy Advance, which belongs to the magic virtual skill and is used to realize virtual group control; exemplarily, the text information on the fourth text control 421 is a translated text corresponding to the English language. The fifth text control 422 is used to indicate the introduction text of the virtual skill name of the virtual character. There is a problem of missing mapping relationship for the fifth text control 422. Specifically, the translation process of the text control shows that the mapping relationship between the translation text and the control identifier is missing. The control identifier of the fifth text control 422 is "6893371218285967222##NO Trans". Due to the missing mapping relationship between the translation text and the control identifier, the translation text of the fifth text control 422 cannot be determined, and only the control identifier of the fifth text control 422 can be displayed on the second interface 420. The sixth text control 423 is used to indicate the virtual attack power of the virtual skill at different levels. The text information on the sixth text control 423 is a translation text corresponding to the English language. For example, Fig.11 The interface diagram shown introduces the translation of text controls using a game application as an example. It can be seen that due to the numerous interfaces in the game, such as the friend team interface, the virtual character introduction interface, the virtual mall interface, the chat room interface, and other interfaces, there are also multiple text controls in each interface that carry text information. When the text controls need to be translated, the number of corresponding text controls is large. As long as there is a situation where the original text information is not correctly translated, the players using the game application cannot effectively read the information in the interface. The technical solution for the translation detection result provided in this embodiment can effectively and automatically verify the translation results for the original text information, mark the unsuccessful translation through the translation detection result, effectively distinguish the unsuccessfully translated original text information in the proper development stage of the game, and improve the efficiency of the application program in detecting the translation results.
[0193] Step 536: When the languages of the translation text and the value of the information component are different, the translation detection result of the text control is the third label;
[0194] Exemplarily, the translated text is the translation result of the original text information, and the value of the information component corresponds to the original text information. When the original text information and the translated text are in different languages, the translation of the text component is completed, and the original text information is correctly translated. Exemplarily, the translated text and the original text information have the same semantic information, and the semantics of the original text information in the first language and the semantics of the translated text in the second language are the same. In one implementation, there is a corresponding relationship between the translated text and the original text information; for example, there is a mapping relationship between the original text information and the control identifier, and there is a one-to-one mapping relationship between the control identifier and the translated text. Through the above two mapping relationships, it is indicated that there is an indirect corresponding relationship between the translated text and the original text information. However, it is not excluded that there is a direct corresponding relationship between the translated text and the original text information.
[0195] Exemplarily, the third tag is used to indicate that the translation process for the text control is completed, and the translated text and the original text information correspond to different languages, indicating that the original text information corresponding to the text control is correctly translated.
[0196] In summary, the method provided in this embodiment obtains the data instance of the text control in the application by obtaining the data instance stored in the form of a data structure, thereby avoiding the problem of not being able to obtain the control identifier and original text information of the text control during the assembly process; the information component is mounted on the text control, and the control identifier and original text information carried in the data instance of the text control are recorded in the form of a mounted component; the difference between the translated text and the information component is compared to determine the detection result label of the translation process for the text control; and the efficiency of checking the translation of the text control is improved.
[0197] In one implementation, the translated text is obtained by translating based on the attribute information of the text control. Specifically, Fig.12 A schematic diagram of a text control provided by an exemplary embodiment of the present application is shown. The first interface 410 is a display interface of an application, and the application is described by taking a game application as an example. Exemplarily, the first interface 410 is a display interface of a virtual character, and the first interface 410 includes multiple text controls for displaying text information. For example, the first text control 411 indicates the prompt text of the first interface 410 "Select a virtual character to appear", and the second text control 412 indicates the introduction information of the virtual character "An elf from the forest, who never misses his arrows and is good at long-range attacks". The third text control 413 provides a functional entrance to enter a virtual game.
[0198] Each text control on the first interface 410 is mounted with an information component, and the information component is used to indicate the attribute information of the text control. The first interface 410 also includes a detection control 415, which is triggered to obtain the information components of the above three text controls on the first interface 410, and by finding the mapping relationship between the control identifier and the translation text, the translation text corresponding to the text control is obtained to achieve the translation of the text information on the first interface.
[0199] To summarize, the method provided in this embodiment provides a functional entry for detecting the translation status of text controls in the current interface through a detection control, with respect to the case where multiple text controls are provided in the interface of the game application. It can be seen that as the number of text controls in the interface increases, the possibility of incorrect translation of the original text information increases. With respect to the case where multiple text controls are provided in the interface of the game application, the detection control can perform detection on the current interface, that is, it provides fine-grained detection with the interface as the granularity. During the development of the game application, the complex interface can be pre-detected based on the detection control, and the problem of incorrect translation of the original text information can be corrected in time during the development process.
[0200] Those skilled in the art can understand that the above embodiments can be implemented independently, or the above embodiments can be freely combined to form new embodiments to implement the text information processing method of the present application.
[0201] Fig.13 The following is a structural block diagram of a text information processing device provided by an exemplary embodiment of the present application. The device includes:
[0202] An acquisition module 810 is used to acquire a data instance corresponding to a text control, wherein the data instance is stored in a data structure, and the data instance carries a control identifier of the text control and original text information carried by the text control;
[0203] The processing module 820 is used to set an information component mounted on the text control according to the data instance, wherein the information component is used to describe the attribute information of the text control;
[0204] The processing module 820 is further configured to obtain a translation text of the text control, and obtain a translation detection result of the text control by comparing the information component with the translation text.
[0205] In an optional implementation of this embodiment, the information component is a component using a key-value pair structure; the processing module 820 is further used to:
[0206] Determine the control identifier carried in the data instance as a keyword of the information component, determine the original text information carried in the data instance as a value of the information component, and set the information component;
[0207] The information component is a subcomponent mounted on the text control.
[0208] In an optional implementation of this embodiment, the processing module 820 is further configured to:
[0209] Determine the control identifier carried in the data instance as a keyword of a first component, determine the original text information carried in the data instance as a value of the first component, and construct the first component;
[0210] The first component is mounted on the text control and determined as the information component.
[0211] In an optional implementation of this embodiment, the acquisition module 810 is further configured to:
[0212] Obtaining a memory page size of a memory space corresponding to the data structure;
[0213] Determining a starting memory page and an ending memory page of the data structure according to the memory page size and the memory address of the data structure;
[0214] The processing module 820 is further configured to:
[0215] The control identifier stored in the starting memory page to the ending memory page is determined as the keyword of the information component, the original text information stored in the starting memory page to the ending memory page is determined as the value of the information component, and the information component is set.
[0216] In an optional implementation of this embodiment, the processing module 820 is further used for at least one of the following:
[0217] In the case where the translation text and the information component have the same value, the translation detection result of the text control is a first label, and the first label is used to indicate that a translation omission occurs in the translation process of the text control;
[0218] In the case where the keywords of the translation text and the information component are the same, the translation detection result of the text control is a second label, and the second label is used to indicate that a mapping relationship between the translation text and the control identifier is missing during the translation process of the text control;
[0219] In the case that the translation text and the value of the information component are in different languages, the translation detection result of the text control is a third label, and the third label is used to indicate that the translation process for the text control is completed.
[0220] In an optional implementation of this embodiment, the acquisition module 810 is further configured to:
[0221] Obtaining the control identifier and the original text information of the text control;
[0222] The control identifier and the original text information are concatenated to obtain a first string, the first string is searched for in data identifiers of multiple candidate data structures to obtain the data instance, and the data identifier of the data structure used to store the data instance is the first string.
[0223] In an optional implementation of this embodiment, the acquisition module 810 is further configured to:
[0224] Obtaining the control identifier of the text control, where the control identifier is a hash value of the original text information;
[0225] Based on the mapping relationship between the original text information and the control identifier, the original text information is searched and obtained according to the control identifier.
[0226] In an optional implementation of this embodiment, the acquisition module 810 is further configured to:
[0227] Acquire index information of the text control, where the index information is used to indicate at least one level upper node to which the text control belongs;
[0228] The first character string is obtained by concatenating the control identifier, the original text information and the index information.
[0229] In an optional implementation of this embodiment, the acquisition module 810 is further configured to:
[0230] Obtain at least two levels of upper nodes to which the text control belongs;
[0231] Arrange the at least two levels of upper nodes in order of belonging relationship to obtain the index information of the text control.
[0232] In an optional implementation of this embodiment, the data instance is used to store a key-value pair, and the key-value pair includes a keyword of the data instance and a value of the data instance;
[0233] The processing module 820 is further configured to:
[0234] The data instance stored in the data structure is constructed based on the control identifier and the original text information; the control identifier corresponds to a keyword of the data instance, and the original text information corresponds to a value of the data instance.
[0235] In an optional implementation of the present embodiment, when the original text information includes web page identification text, storage path text, the original text information is empty, or the original text information consists of numbers, the data structure corresponding to the text control is empty, and the data structure is empty to indicate that the text control does not need to compare the information component and the translated text of the text control.
[0236] One point that needs to be explained is that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0237] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method; the technical effects achieved by each module performing operations are the same as those in the embodiment of the method, and will not be elaborated here.
[0238] An embodiment of the present application also provides a computer device, which includes: a processor and a memory, wherein a computer program is stored in the memory; the processor is used to execute the computer program in the memory to implement the text information processing method provided by the above-mentioned method embodiments.
[0239] Optionally, the computer device is a server. Fig.14 It is a structural block diagram of a server provided by an exemplary embodiment of the present application.
[0240] Typically, the server 2300 includes: a processor 2301 and a memory 2302 .
[0241] The processor 2301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 2301 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 2301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 2301 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 2301 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0242] The memory 2302 may include one or more computer-readable storage media, which may be non-transitory. The memory 2302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 2302 is used to store at least one instruction, which is used to be executed by the processor 2301 to implement the text information processing method provided in the method embodiment of the present application.
[0243] In some embodiments, the server 2300 may also optionally include: an input interface 2303 and an output interface 2304. The processor 2301, the memory 2302, the input interface 2303, and the output interface 2304 may be connected via a bus or a signal line. Each peripheral device may be connected to the input interface 2303 and the output interface 2304 via a bus, a signal line, or a circuit board. The input interface 2303 and the output interface 2304 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 2301 and the memory 2302. In some embodiments, the processor 2301, the memory 2302, the input interface 2303, and the output interface 2304 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2301, the memory 2302, the input interface 2303, and the output interface 2304 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.
[0244] Those skilled in the art will appreciate that the structure shown above does not constitute a limitation on the server 2300 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0245] In an exemplary embodiment, a chip is also provided. The chip includes a programmable logic circuit and / or program instructions. When the chip runs on a computer device, it is used to implement the text information processing method described in the above aspects.
[0246] In an exemplary embodiment, a computer program product is also provided, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor reads and executes the computer instructions from the computer-readable storage medium to implement the text information processing method provided by the above-mentioned method embodiments.
[0247] In an exemplary embodiment, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the text information processing method provided by the above-mentioned method embodiments.
[0248] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0249] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0250] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for processing text information, characterized in that: The method comprises: Acquire a data instance corresponding to a text control, wherein the data instance is stored in a data structure, and the data instance carries a control identifier of the text control and original text information carried by the text control; According to the data instance, an information component mounted on the text control is set, wherein the information component is used to describe the attribute information of the text control; The translated text of the text control is obtained, and the translation detection result of the text control is obtained by comparing the information component with the translated text.
2. The method according to claim 1, characterized in that: The information component is a component using a key-value pair structure; the information component mounted on the text control is set according to the data instance, including: Determine the control identifier carried in the data instance as a keyword of the information component, determine the original text information carried in the data instance as a value of the information component, and set the information component; The information component is a subcomponent mounted on the text control.
3. The method according to claim 2, characterized in that The step of determining the control identifier carried in the data instance as a keyword of the information component, determining the original text information carried in the data instance as a value of the information component, and setting the information component includes: Determine the control identifier carried in the data instance as a keyword of a first component, determine the original text information carried in the data instance as a value of the first component, and construct the first component; The first component is mounted on the text control and determined as the information component.
4. The method according to claim 2, characterized in that: The method further comprises: Obtaining a memory page size of a memory space corresponding to the data structure; Determining a starting memory page and an ending memory page of the data structure according to the memory page size and the memory address of the data structure; The step of determining the control identifier carried in the data instance as a keyword of the information component, determining the original text information carried in the data instance as a value of the information component, and setting the information component includes: The control identifier stored in the starting memory page to the ending memory page is determined as the keyword of the information component, the original text information stored in the starting memory page to the ending memory page is determined as the value of the information component, and the information component is set.
5. The method according to any one of claims 2 to 4, characterized in that: The obtaining of the translation detection result of the text control according to the comparison between the information component and the translation text includes at least one of the following: In the case where the translation text and the information component have the same value, the translation detection result of the text control is a first label, and the first label is used to indicate that a translation omission occurs in the translation process of the text control; In the case where the keywords of the translation text and the information component are the same, the translation detection result of the text control is a second label, and the second label is used to indicate that a mapping relationship between the translation text and the control identifier is missing during the translation process of the text control; In the case that the translation text and the value of the information component are in different languages, the translation detection result of the text control is a third label, and the third label is used to indicate that the translation process for the text control is completed.
6. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining the data instance corresponding to the text control includes: Obtaining the control identifier and the original text information of the text control; The control identifier and the original text information are concatenated to obtain a first string, the first string is searched for in data identifiers of multiple candidate data structures to obtain the data instance, and the data identifier of the data structure used to store the data instance is the first string.
7. The method according to claim 6, characterized in that The obtaining the control identifier and the original text information of the text control includes: Obtaining the control identifier of the text control, where the control identifier is a hash value of the original text information; Based on the mapping relationship between the original text information and the control identifier, the original text information is searched and obtained according to the control identifier.
8. The method according to claim 6, characterized in that The method further comprises: Acquire index information of the text control, where the index information is used to indicate at least one level upper node to which the text control belongs; The first character string is obtained by concatenating the control identifier, the original text information and the index information.
9. The method according to claim 8, characterized in that The obtaining of index information of the text control includes: Obtain at least two levels of upper nodes to which the text control belongs; Arrange the at least two levels of upper nodes in order of belonging relationship to obtain the index information of the text control.
10. The method according to claim 6, characterized in that The data instance is used to store a key-value pair, wherein the key-value pair includes a keyword of the data instance and a value of the data instance; The method further comprises: The data instance stored in the data structure is constructed based on the control identifier and the original text information; the control identifier corresponds to a keyword of the data instance, and the original text information corresponds to a value of the data instance.
11. The method according to any one of claims 1 to 4, characterized in that: When the original text information includes web page identification text, storage path text, the original text information is empty, or the original text information consists of numbers, the data structure corresponding to the text control is empty, and the data structure is empty to indicate that the text control does not need to compare the information component and the translated text of the text control.
12. A text information processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a data instance corresponding to a text control, wherein the data instance is stored in a data structure, and the data instance carries a control identifier of the text control and original text information carried by the text control; A processing module, used for setting an information component mounted on the text control according to the data instance, wherein the information component is used for describing the attribute information of the text control; The processing module is further used to obtain the translated text of the text control, and obtain the translation detection result of the text control by comparing the information component with the translated text.
13. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein the memory stores at least one program; the processor is used to execute the at least one program in the memory to implement the text information processing method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The readable storage medium stores executable instructions, and the executable instructions are loaded and executed by a processor to implement the text information processing method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the text information processing method according to any one of claims 1 to 11.