Methods, apparatus, and computer program products for application testing

CN116011433BActive Publication Date: 2026-09-11EMC IP HLDG CO LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111234077.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2026-09-11
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

在应用的本地化过程中,语言的本地化是至关重要的环节,不正确的翻译会导致应用的可用性或语言质量问题,其严重影响用户对于应用的正常使用

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116011433B_ABST
    Figure CN116011433B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method, an electronic device and a computer program product for application testing. The method comprises: obtaining a string in an application interface of a target application; determining a current language corresponding to the string based on at least a comparison between an encoding representation of the string and a set of predetermined encoding segments, each encoding segment in the set of predetermined encoding segments indicating a corresponding language; and determining a language test result for the string based on a comparison between the current language and a target language in which the target application is to be presented, the language test result being used to indicate whether the string is adapted to the target language. In this way, it can be ensured that the text display of the target application is efficiently detected for abnormality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of this disclosure relate to the field of computers, and more specifically, to methods, apparatus, and computer program products for application testing. Background Technology

[0002] With the development of network technology, more and more applications need to provide services to users in different regions. This necessitates software localization to adapt to the habits of users in the corresponding regions. Language localization is a crucial step in the application localization process; incorrect translation can lead to usability or language quality issues, severely impacting users' ability to use the application normally. Summary of the Invention

[0003] The embodiments of this disclosure provide a scheme for application testing.

[0004] According to a first aspect of this disclosure, an application testing method is proposed. The method includes: acquiring a string from the application interface of a target application; determining a current language corresponding to the string based at least on a comparison of the string's encoded representation with a set of predetermined encoding segments, each encoding segment in the set of predetermined encoding segments indicating a corresponding language; and determining a language test result for the string based on a comparison between the current language and a target language to be presented in the target application, the language test result indicating whether the string is compatible with the target language.

[0005] According to a second aspect of this disclosure, an electronic device is proposed. The device includes: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the device to perform an action including: acquiring a string from an application interface of a target application; determining a current language corresponding to the string based at least on a comparison of the encoded representation of the string with a set of predetermined encoding segments, each encoding segment in the set of predetermined encoding segments indicating a corresponding language; and determining a language test result for the string based on a comparison between the current language and a target language to be presented by the target application, the language test result indicating whether the string is compatible with the target language.

[0006] In a third aspect of this disclosure, a computer program product is provided. The computer program product is stored in a non-transitory computer storage medium and includes machine-executable instructions that, when executed in a device, cause the device to perform any step of the method described in the first aspect of this disclosure.

[0007] The summary section is provided to present the chosen concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or essential features of this disclosure, nor is it intended to limit the scope of this disclosure. Attached Figure Description

[0008] The above and other objects, features and advantages of this disclosure will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.

[0009] Figure 1 A schematic diagram of an example system in which embodiments of the present disclosure may be implemented is shown;

[0010] Figure 2 A flowchart of an application testing method according to some embodiments of the present disclosure is shown;

[0011] Figure 3 A flowchart illustrating a method for determining the current language according to further embodiments of the present disclosure is shown; and

[0012] Figure 4 A block diagram of an example device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0013] Preferred embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.

[0014] The term "comprising" and its variations as used herein signify open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0015] As mentioned earlier, language localization is a crucial part of application localization. Incorrect translations can lead to usability or language quality issues, severely impacting user experience. However, current application testing processes rely on manual review of strings in the application interface, a process that is inefficient and prone to errors.

[0016] According to embodiments of this disclosure, an application testing scheme is provided. In this scheme, strings from the application interface of a target application can be obtained. Further, the current language corresponding to the string can be determined at least based on a comparison between the encoded representation of the string and a set of predetermined encoding segments, wherein each encoding segment in the set of predetermined encoding segments indicates the corresponding language. Additionally, a language test result for the string can be determined based on a comparison between the current language and the target language to be presented by the target application, wherein the language test result indicates whether the string is compatible with the target language.

[0017] Based on this approach, embodiments of this disclosure can automatically detect the accuracy of Chinese text in the target application, thereby effectively detecting omissions in text translation, garbled text, and other issues in the application, and helping to improve the quality of application localization.

[0018] Figure 1 An example environment 100 in which embodiments of this disclosure may be executed is shown. For example... Figure 1 As shown, the environment 100 includes a test device 130, which can, for example, acquire a string 120 in the target application 110 and determine a language test result 140 for the string 120.

[0019] In some embodiments, the target application 110 may include any suitable type of application (also referred to as a program or application), examples of which include, but are not limited to, web applications, mobile applications, or desktop applications.

[0020] The following will combine Figures 2 to 3 This section describes in detail the process by which the test device 130 automatically tests the language localization of the target application 110.

[0021] Figure 2 A flowchart of an application testing process 200 according to some embodiments of the present disclosure is shown. Process 200 may, for example, be performed by... Figure 1 The test device 130 shown is used to implement this.

[0022] like Figure 2 As shown in box 202, test device 130 obtains string 120 from the application interface of target application 110.

[0023] In some embodiments, the test device 130 can obtain the string 120 in the application interface by parsing the application interface of the target application 110.

[0024] For example, test device 130 can run test cases to traverse, for example, all application interfaces of target application 110, and obtain string 120 by acquiring the source code corresponding to the application interface. For example, taking a web application as an example, test device 130 can acquire the source code corresponding to the application interface of the web application and extract string 120 from it.

[0025] In some embodiments, the test device 130 may also be based on image recognition technology to extract string 120 from images of the application interface.

[0026] In some embodiments, the test device 130 may also acquire a language resource pack associated with the target application 110, which may include, for example, strings displayed in the application interface. Further, the test device 130 may acquire a corresponding string 120 from the language resource pack.

[0027] In some embodiments, string 120 may include, for example, a word, sentence, or paragraph consisting of one or more characters.

[0028] In box 204, test device 130 determines the current language corresponding to string 120 based at least on a comparison of the encoded representation of string 120 with a set of predetermined encoded segments, each of the predetermined encoded segments indicating the corresponding language.

[0029] In some embodiments, the test device 130 may first convert the string 120 into an encoded representation under a specific encoding format. Examples of such encoding formats may include, but are not limited to, UTF-8 encoding, UTF-16 encoding, Unicode encoding, etc.

[0030] In some embodiments, certain encoding segments under an encoding format can uniquely indicate the corresponding language. For example, taking Unicode encoding as an example, languages ​​such as Chinese, Korean, and Japanese each have unique encoding segments. For instance, the encoding segment corresponding to basic Chinese characters is "4E00-9FA5".

[0031] Furthermore, the test device 130 determines the current language corresponding to string 120 by comparing the encoded representation of string 120 with these predetermined encoded segments. The following will combine... Figure 3 Let's describe the detailed process of box 204. Figure 3 A flowchart of a process 300 for determining the current language according to an embodiment of the present disclosure is shown.

[0032] like Figure 3As shown, in box 302, test device 130 can determine whether the encoded representation of string 120 matches any of the code segments in a set of predetermined code segments. If it is determined in box 302 that the encoded representation matches the target code segment, process 300 can proceed to box 310. In box 310, test device 130 can determine the language corresponding to the target code segment as the current language.

[0033] For example, if the encoded representation of string 120 falls within the encoding segment corresponding to Chinese, then test device 130 can determine the current language of string 120 as Chinese.

[0034] Conversely, if it is determined in box 302 that the encoded representation does not match any of the predetermined encoded segments, then process 300 can proceed to box 304. In box 304, test device 130 can generate a set of tokens based on the string.

[0035] In some embodiments, the test device 130 may utilize N-grams to generate a set of lexical units of the same length. Taking English as an example, for the string "abcde", the test device 130 may generate a set of lexical units of length 3: "abc", "bcd", and "cde".

[0036] In box 306, the testing device 130 can determine the current word frequency of a set of words in string 130. Specifically, the testing device 130 can determine the frequency of each word in string 130, thereby determining a set of frequencies corresponding to that set of words.

[0037] In box 308, test device 130 can determine the current language corresponding to the string based on a comparison between the current lexical frequency and the frequencies of multiple reference lexical terms corresponding to multiple candidate languages.

[0038] In some embodiments, the testing device 130 may also acquire multiple reference lexical frequencies corresponding to multiple candidate languages. The reference lexical frequencies may, for example, describe the frequency of each lexical occurrence in its corresponding language.

[0039] In some embodiments, the testing device 130 may further determine the current language of the string 130 based on the distance between lexical frequencies. Specifically, the testing device 130 may determine a first distance between the current lexical frequency and a first reference lexical frequency corresponding to a first reference language, wherein the first reference language corresponds to the original development language of the target application 110.

[0040] For example, the target application 110 may originally be developed in English, but needs to be localized to French. Accordingly, the test device 130 can determine a first distance between the current word frequency and the corresponding English word frequency.

[0041] Specifically, the testing device 130 can determine the lexical distance for each lexical in a set of lexical units. For example, the testing device 130 can determine whether the lexical unit is included in the frequency with a first reference lexical unit.

[0042] If the terminology is not included in the first reference terminology frequency, the terminology distance can be set to a large predetermined value, for example. Conversely, if the terminology is included in the first reference terminology frequency, the terminology distance can be determined as the difference between the first frequency of the terminology in the string and the second frequency indicated by the first reference terminology frequency.

[0043] Furthermore, the test device 130 can determine the first distance between the current word frequency and the first reference word frequency based on the word distance of each word in the group of words.

[0044] Furthermore, the testing device 130 can also determine a second distance between the current lexical frequency and a second reference lexical frequency corresponding to the target language. For example, if the target application 110 was originally developed based on English but needs to be localized to French, the target language can be determined to be French. The testing device 130 can further determine the second distance based on the current lexical frequency and the domain lexical frequency corresponding to the domain.

[0045] In some embodiments, if the first distance is greater than the second distance, the testing device 130 may determine the target language as the current language. Conversely, if the first distance is less than or equal to the second distance, the testing device 130 may determine the first reference language as the current language.

[0046] Continue to refer to Figure 2 In box 206, the test device 130 determines a language test result for a string based on a comparison between the current language and the target language to be presented in the target application. The language test result indicates whether the string is compatible with the target language. In some embodiments, the target language may represent the language corresponding to the region where the target application is to be localized.

[0047] In some embodiments, if the current language matches the target language, the testing device 130 may, for example, determine that the language of string 120 conforms to localization requirements. Additionally, the testing device 130 may also determine, for example, the syntactic and / or semantic rationality of string 120, and further determine the language test result for the string based on the syntactic and / or semantic rationality.

[0048] It should be understood that any appropriate natural language processing technique can be used to determine the syntactic and semantic rationality of a string. This disclosure is not intended to limit this.

[0049] For example, the language test result of string 120 can indicate that the current language of the string is the target language, and that the syntax and semantics of the string conform to the specifications of the target language.

[0050] In some embodiments, if the current language of string 120 does not match the target language, the test device 130 can also determine whether the string is a preset string that is allowed to be presented by querying a predetermined set of strings.

[0051] For example, if the target language is Chinese, but some interfaces may still allow the display of certain non-Chinese strings, these strings can be added to a predefined string set, for example, as a display whitelist.

[0052] In some embodiments, if string 120 is determined to be a preset string that is allowed to be presented, test device 130 may determine language test result 140 for string 120 to indicate that character 120 is adapted to the target language.

[0053] In some embodiments, if the current language of string 120 is not the target language and string 120 is not a preset string that is allowed to be presented, then test device 130 can determine the language test result 140 for the string to indicate that string 120 is not suitable for the target language.

[0054] In some embodiments, if the language test result 140 indicates that string 120 is not compatible with the target language, the test device 140 may also generate a warning associated with string 120 to indicate that string 120 is not compatible with the target language. For example, the test device 140 may indicate which string in which application interface is not compatible with the target language via a graphical interface.

[0055] In some embodiments, the testing device 130 may also present the language test results 140 determined based on the process discussed above to the user in an appropriate manner, such as a graphical interface, email, or text message.

[0056] Based on the process discussed above, the embodiments of this disclosure can automate the testing process of application language localization and automatically identify characters in the application, such as untranslated characters or improperly displayed characters (e.g., garbled text). Therefore, the embodiments of this disclosure can help improve the testing efficiency of language localization and enhance the usability of the localized application.

[0057] Figure 4A schematic block diagram of an example device 400 that can be used to implement embodiments of the present disclosure is shown. For example, a test device 130 according to an embodiment of the present disclosure can be implemented by device 400. As shown, device 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 402 or loaded from storage unit 408 into random access memory (RAM) 403. Various programs and data required for the operation of device 400 may also be stored in RAM 403. CPU 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0058] Multiple components in device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of monitors, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0059] The various processes and handling described above, such as process 200 and / or process 300, may be executed by processing unit 401. For example, in some embodiments, process 200 and / or process 300 may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by CPU 401, one or more actions of process 200 and / or process 300 described above may be performed.

[0060] This disclosure can be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.

[0061] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0062] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0063] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0064] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0065] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0066] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0067] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0068] Various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for application testing, comprising: The strings in the application interface of the target application are obtained by parsing the application interface of the target application; The string is converted into its encoded representation, wherein the encoded representation of the string includes the Unicode Conversion Format (UTF) encoded representation of the string; The current language corresponding to the string is determined by comparing the encoded representation of the string with a set of predetermined encoding segments, each of the predetermined encoding segments indicating the corresponding language; as well as Based on a comparison between the current language and the target language to be presented by the target application, a language test result is determined for the string. This language test result indicates whether the string is suitable for the target language. Determining the language test result for the string includes: In response to a mismatch between the current language and the target language, a query is performed on a predefined string set to determine whether the string is a preset string that is allowed to be displayed. In response to the string being one of the allowed preset strings, a language test result for the string is determined to indicate that the string is adapted to the target language. In response to the string not being one of the preset strings allowed to be presented, the language test result for the string is determined to indicate that the string is not compatible with the target language, and a warning associated with the string is generated via the graphical user interface of the test device to indicate that the string is not compatible with the target language, thereby identifying characters of the target application that have not been translated into the target language.

2. The method according to claim 1, wherein determining the current language corresponding to the string comprises: In response to the encoding representation matching a target encoding segment in the set of predetermined encoding segments, the language corresponding to the target encoding segment is determined as the current language.

3. The method according to claim 1, wherein determining the current language corresponding to the string includes: In response to a mismatch between the encoded representation and the set of predetermined encoded segments, a set of lexical units is generated based on the string; Determine the frequency of the current term in the string of the set of terms; as well as Based on the comparison between the current lexical frequency and the frequencies of multiple reference lexical terms corresponding to multiple candidate languages, the current language corresponding to the string is determined.

4. The method according to claim 3, wherein generating a set of lexical units based on the string comprises: Generate the set of lexical units with a predetermined length based on the string.

5. The method according to claim 3, wherein determining the current language corresponding to the string based on a comparison between the current lexical frequency and the frequencies of multiple reference lexical terms corresponding to multiple candidate languages ​​comprises: Determine a first distance between the current lexical frequency and a first reference lexical frequency corresponding to a first reference language, wherein the first reference language corresponds to the original development language of the target application; Determine the second distance between the current lexical frequency and the second reference lexical frequency corresponding to the target language; as well as In response to the first distance being greater than the second distance, the target language is determined as the current language.

6. The method according to claim 5, wherein determining the current language corresponding to the string based on a comparison between the current lexical frequency and the frequencies of multiple reference lexical terms corresponding to multiple candidate languages ​​further comprises: In response to the first distance being less than or equal to the second distance, the target language is determined as the current language.

7. The method of claim 1, wherein determining the language test result for the string comprises: In response to a match between the current language and the target language, the syntactic and semantic rationality of the string is determined. as well as Based on the grammatical rationality and the semantic rationality, the language test result for the string is determined.

8. An electronic device, comprising: At least one processing unit; At least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform an action, the action including: The strings in the application interface of the target application are obtained by parsing the application interface of the target application; The string is converted into its encoded representation, wherein the encoded representation of the string includes the Unicode Conversion Format (UTF) encoded representation of the string; The current language corresponding to the string is determined based at least on a comparison of the encoded representation of the string with a set of predetermined encoding segments, each of the predetermined encoding segments indicating the corresponding language; and Based on a comparison between the current language and the target language to be presented by the target application, a language test result is determined for the string. This language test result indicates whether the string is suitable for the target language. Determining the language test result for the string includes: In response to a mismatch between the current language and the target language, a query is performed on a predefined string set to determine whether the string is a preset string that is allowed to be displayed. In response to the string being one of the allowed preset strings, a language test result for the string is determined to indicate that the string is adapted to the target language. In response to the string not being one of the preset strings allowed to be presented, the language test result for the string is determined to indicate that the string is not compatible with the target language, and a warning associated with the string is generated via the graphical user interface of the electronic device to indicate that the string is not compatible with the target language, thereby identifying characters of the target application that have not been translated into the target language.

9. The electronic device of claim 8, wherein determining the current language corresponding to the string comprises: In response to the encoding representation matching a target encoding segment in the set of predetermined encoding segments, the language corresponding to the target encoding segment is determined as the current language.

10. The electronic device of claim 8, wherein determining the current language corresponding to the string comprises: In response to a mismatch between the encoded representation and the set of predetermined encoded segments, a set of lexical units is generated based on the string; Determine the frequency of the current term in the string of the set of terms; as well as Based on the comparison between the current lexical frequency and the frequencies of multiple reference lexical terms corresponding to multiple candidate languages, the current language corresponding to the string is determined.

11. The electronic device of claim 10, wherein generating a set of lexical units based on the string comprises: Generate the set of lexical units with a predetermined length based on the string.

12. The electronic device of claim 10, wherein determining the current language corresponding to the string based on a comparison of the current lexical frequency with the frequencies of a plurality of reference lexical terms corresponding to a plurality of candidate languages ​​comprises: Determine a first distance between the current lexical frequency and a first reference lexical frequency corresponding to a first reference language, wherein the first reference language corresponds to the original development language of the target application; Determine the second distance between the current lexical frequency and the second reference lexical frequency corresponding to the target language; as well as In response to the first distance being greater than the second distance, the target language is determined as the current language.

13. The electronic device of claim 12, wherein determining the current language corresponding to the string based on a comparison of the current lexical frequency with the frequencies of multiple reference lexical terms corresponding to multiple candidate languages ​​further comprises: In response to the first distance being less than or equal to the second distance, the target language is determined as the current language.

14. The electronic device of claim 8, wherein determining the language test result for the string comprises: In response to a match between the current language and the target language, the syntactic and semantic rationality of the string is determined. as well as Based on the grammatical rationality and the semantic rationality, the language test result for the string is determined.

15. A computer program product stored in a non-transient computer storage medium and comprising machine-executable instructions that, when executed in a device, cause the device to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Processing method and device and machine readable medium

    CN107564526A

  • One-key multi-language conference aided translation method and device with same

    CN113505609A