A method, device and electronic device for adjusting region

By adjusting the width of the original text editing area and translation display area of ​​the translation interface according to the translation language, the problem of misalignment in the translation of non-Indo-European languages ​​and Indo-European languages ​​is solved, the high consistency between the original text and the translation is achieved, and the translation is improved readability and accuracy.

CN112329480BActive Publication Date: 2024-11-12BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910656601.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-19
Publication Date
2024-11-12
Estimated Expiration
2040-04-25

AI Technical Summary

Technical Problem

When existing translation tools translate Chinese or other non-Indo-European languages ​​with Indo-European languages ​​using Latin letters, the comparison between the original editing area and the translation display area is misaligned, and it cannot be effectively adjusted to ensure the accuracy of the comparison.

Method used

By determining the original language and translation language of the translation interface, calculate and adjust the width of the original editing area and translation display area to match the preset ratio information, ensuring that the two are highly consistent, thereby avoiding comparison misalignment.

Benefits of technology

It achieves a high degree of consistency between the original text and the translation during the translation process, avoids comparison misalignment, and improves the readability and accuracy of the translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112329480B_ABST
    Figure CN112329480B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a method, device and electronic device for adjusting an area, wherein the method comprises: determining an original language of a translated original text in an original text editing area of ​​a translation interface, and a translation language of a translation corresponding to the translated original text; determining matching preset ratio information according to the original language and the translation language; adjusting the width of the original text editing area and the width of a translation display area in the translation interface according to the matching preset ratio information, and displaying the translation in the translation display area; and then adjusting the height of the translated original text in the adjusted original text editing area and the translation in the translation display area after the width is adjusted to be equal, thereby avoiding confusion between the translated original text and the translation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a region adjustment method, device and electronic equipment. Background Art

[0002] With the advancement of globalization, exchanges between countries in academia, business, life, etc. (such as academic exchanges, import and export trade of goods, and overseas travel) have become increasingly frequent, but there are differences in languages ​​among countries. Users may not be able to master the language of each country, which will bring certain obstacles to users in academic, business, life, etc. Therefore, in order to solve the obstacles brought to users by language barriers, translation tools have come into being; users can use translation applications to translate text in one language into text in another language, such as translating English into Chinese, Korean into Chinese, English into German, and so on.

[0003] Most existing translation tools are designed based on translation between different language groups within the Indo-European language family, that is, mutual translation between different languages ​​written in Latin letters, such as English-German, English-French, English-Russian, etc. Due to the affinity of different language groups within the Indo-European language family and the similarity of written letters, the layout effect of languages ​​is approximately 1:1 under the premise of expressing the same information content. Therefore, the ratio of the original text editing area to the translation display area in the current translation tools is a fixed 1:1 design.

[0004] However, the typesetting effect of Chinese or other non-Indo-European languages ​​(including Indo-European languages ​​that do not use Latin letters (such as Sanskrit and Persian)) and Indo-European languages ​​that use Latin letters is not 1:1. As a result, when translating Chinese or other non-Indo-European languages ​​(including Indo-European languages ​​that do not use Latin letters (such as Sanskrit and Persian)) and Indo-European languages ​​that use Latin letters, if the fixed 1:1 typesetting of existing translation tools is used, the original text in the source text editing area and the translated text in the translation display area will be misaligned. Figure 1 shown. Summary of the invention

[0005] The embodiment of the present invention provides a region adjustment method to avoid misalignment between the translation original text in the original text editing area and the translation translated text in the translation display area.

[0006] Correspondingly, an embodiment of the present invention further provides a region adjustment device and an electronic device to ensure the implementation and application of the above method.

[0007] In order to solve the above problems, an embodiment of the present invention discloses a region adjustment method, which specifically includes: determining the original language of the translated original text in the original text editing area of ​​the translation interface, and the translation language of the translated text corresponding to the translated original text; determining matching preset ratio information based on the original text language and the translated text language; adjusting the width of the original text editing area and the width of the translated text display area in the translation interface based on the matching preset ratio information, and displaying the translated text in the translated text display area.

[0008] Optionally, adjusting the width of the original text editing area and the width of the translated text display area in the translation interface according to the matching preset ratio information includes: obtaining the total width of the original text editing area and the translated text display area in the translation interface; and adjusting the width of the original text editing area and the width of the translated text display area according to the matching preset ratio information and the total width.

[0009] Optionally, adjusting the width of the original text editing area and the width of the translated text display area based on the matched preset ratio information and the total width includes: calculating a first target width corresponding to the original text editing area and a second target width corresponding to the translated text display area based on the matched preset ratio information and the total width; adjusting the width of the original text editing area to the first target width, and adjusting the width of the translated text display area to the second target width.

[0010] Optionally, the determining matching preset ratio information according to the source language and the target language includes: searching for a mapping relationship based on the source language and the target language to determine the matching preset ratio information.

[0011] Optionally, the method further includes the step of determining preset ratio information: translating a reference translation text in one language into reference translation texts in multiple other languages ​​respectively; recording the original text height of the reference translation text in a preset area, and recording the translation height of each reference translation text in the preset area; determining the preset ratio information between the language and each other language based on the ratio of the original text height to the translation height; wherein the preset area, the original text editing area and the translation display area have the same display style, and the reference translation text includes multiple sentences.

[0012] Optionally, the method further includes the step of determining preset ratio information: for a language pair, extracting multiple groups of samples corresponding to the language pair based on a statistical method, wherein a group of samples includes samples of two languages ​​expressing the same content, and a sample of one language is a sentence; determining a first cumulative height of multiple samples of one language in a preset area, and determining a second cumulative height of multiple samples of another language in the preset area; determining the preset ratio information corresponding to the language pairs based on the ratio of the first cumulative height to the second cumulative height; wherein the preset area, the original text editing area and the translation display area have the same display style.

[0013] Optionally, the same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

[0014] The embodiment of the present invention also discloses a region adjustment device, which specifically includes: a language determination module, which is used to determine the original language of the translated original text in the original text editing area of ​​the translation interface, and the translation language of the translated text corresponding to the translated original text; a ratio determination module, which is used to determine matching preset ratio information based on the original text language and the translation language; and a region adjustment module, which is used to adjust the width of the original text editing area and the width of the translation display area in the translation interface based on the matching preset ratio information, and display the translated text in the translation display area.

[0015] Optionally, the area adjustment module includes: a width acquisition submodule, used to obtain the total width of the original text editing area and the translation display area in the translation interface; a width adjustment submodule, used to adjust the width of the original text editing area and the width of the translation display area according to the matching preset ratio information and the total width.

[0016] Optionally, the width adjustment submodule is used to calculate a first target width corresponding to the original text editing area and a second target width corresponding to the translation display area based on the matched preset ratio information and the total width; adjust the width of the original text editing area to the first target width, and adjust the width of the translation display area to the second target width.

[0017] Optionally, the ratio determination module is used to search for a mapping relationship based on the source language and the target language to determine matching preset ratio information.

[0018] Optionally, the device also includes: a first ratio information determination module, which is used to translate a reference translation text in one language into reference translation texts in multiple other languages ​​respectively; record the original text height of the reference translation text in a preset area, and record the translation height of each reference translation text in the preset area; determine the preset ratio information between the language and each other language based on the ratio of the original text height to the translation height; wherein the preset area, the original text editing area and the translation display area have the same display style, and the reference translation text includes multiple sentences.

[0019] Optionally, the device further includes: a second ratio information determination module, which is used to extract multiple groups of samples corresponding to a language pair according to a statistical device, wherein a group of samples includes samples of two languages ​​with the same expression content, and a sample of one language is a sentence; determine a first cumulative height of multiple samples of one language in a preset area, and determine a second cumulative height of multiple samples of another language in the preset area; determine the corresponding preset ratio information between the language pairs according to the ratio of the first cumulative height to the second cumulative height; wherein the display styles of the preset area, the original text editing area and the translation display area are the same.

[0020] Optionally, the same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

[0021] An embodiment of the present invention further discloses a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the region adjustment method as described in any one of the embodiments of the present invention.

[0022] An embodiment of the present invention also discloses an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: determining the original language of the translated original text in the original text editing area of ​​the translation interface, and the target language of the translated text corresponding to the translated original text; determining matching preset ratio information based on the original text language and the target language; adjusting the width of the original text editing area and the width of the target text display area in the translation interface based on the matching preset ratio information, and displaying the translated text in the target text display area.

[0023] Optionally, adjusting the width of the original text editing area and the width of the translated text display area in the translation interface according to the matching preset ratio information includes: obtaining the total width of the original text editing area and the translated text display area in the translation interface; and adjusting the width of the original text editing area and the width of the translated text display area according to the matching preset ratio information and the total width.

[0024] Optionally, adjusting the width of the original text editing area and the width of the translated text display area based on the matched preset ratio information and the total width includes: calculating a first target width corresponding to the original text editing area and a second target width corresponding to the translated text display area based on the matched preset ratio information and the total width; adjusting the width of the original text editing area to the first target width, and adjusting the width of the translated text display area to the second target width.

[0025] Optionally, the determining matching preset ratio information according to the source language and the target language includes: searching for a mapping relationship based on the source language and the target language to determine the matching preset ratio information.

[0026] Optionally, it also includes instructions for performing the following operations to determine preset ratio information: translating a reference translation text in one language into reference translation texts in multiple other languages ​​respectively; recording the original text height of the reference translation text in a preset area, and recording the translation height of each reference translation text in the preset area; determining the preset ratio information between the language and each other language based on the ratio of the original text height to the translation height; wherein the preset area, the original text editing area and the translation display area have the same display style, and the reference translation text includes multiple sentences.

[0027] Optionally, the method further includes instructions for performing the following operations of determining preset ratio information: for a language pair, extracting multiple groups of samples corresponding to the language pair based on a statistical electronic device, wherein a group of samples includes samples of two languages ​​with the same expression content, and a sample of one language is a sentence; determining a first cumulative height of multiple samples of one language in a preset area, and determining a second cumulative height of multiple samples of another language in the preset area; determining the corresponding preset ratio information between the language pairs based on the ratio of the first cumulative height to the second cumulative height; wherein the preset area, the original text editing area and the translation display area have the same display style.

[0028] Optionally, the same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

[0029] The embodiments of the present invention include the following advantages:

[0030] In the embodiment of the present invention, the original language of the translated original text in the original text editing area of ​​the translation interface and the target language of the translated text corresponding to the translated original text can be determined, and then the matching preset ratio information is determined according to the original text language and the target language, and then the width of the original text editing area and the width of the target text display area in the translated interface are adjusted according to the matching preset ratio information, and the translated text is displayed in the target text display area; and then the height of the translated original text in the adjusted original text editing area and the height of the translated text in the adjusted target text display area can be adjusted to be equal, so as to avoid confusion between the translated original text and the translated text. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of a translation interface in the prior art;

[0032] Figure 2 A flowchart of a method for adjusting a region according to an embodiment of the present invention;

[0033] Figure 3a This is a schematic diagram of a translation interface after adjusting the width of the original text editing area and the translation display area according to an embodiment of the present invention;

[0034] Figure 3b This is another schematic diagram of a translation interface after adjusting the width of the original text editing area and the translation display area according to an embodiment of the present invention;

[0035] Figure 3c This is another schematic diagram of a translation interface after adjusting the width of the original text editing area and the translation display area according to an embodiment of the present invention;

[0036] Figure 4 is a flowchart of a method for determining preset ratio information according to an embodiment of the present invention;

[0037] Figure 5a It is a schematic diagram of the height of a reference translation original text in Chinese in a preset area according to an embodiment of the present invention;

[0038] Figure 5b It is a schematic diagram of the height of a reference translation in Arabic in a preset area according to an embodiment of the present invention;

[0039] Figure 5c It is a schematic diagram of a Japanese reference translation in a preset area according to an embodiment of the present invention;

[0040] Figure 5d It is a schematic diagram of a reference translation of English in a preset area according to an embodiment of the present invention;

[0041] Figure 6 is a flowchart of steps of an optional embodiment of a method for determining preset ratio information of the present invention;

[0042] Figure 7 is a flowchart of steps of an optional embodiment of a region adjustment method of the present invention;

[0043] Figure 8 is a structural block diagram of an embodiment of a region adjustment device of the present invention;

[0044] Fig. 9 is a structural block diagram of an optional embodiment of a region adjustment device of the present invention;

[0045] Fig.10 A structural block diagram of an electronic device for region adjustment according to an exemplary embodiment;

[0046] Fig.11 It is a structural schematic diagram of an electronic device for area adjustment according to another exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] One of the core concepts of the embodiment of the present invention is to adjust the width of the original text editing area and the translation display area in the translation interface according to the language of the original text and the language of the translation target, thereby avoiding misalignment of the original text and the translation target.

[0049] The original text editing area in the translation interface is used to edit the original text for translation, and the translated text display area is used to display the translated text.

[0050] Reference Figure 2 , shows a flow chart of steps of an embodiment of a region adjustment method of the present invention, which may specifically include the following steps:

[0051] Step 202: Determine the original language of the translated text in the original text editing area of ​​the translation interface and the target language of the target text corresponding to the translated text.

[0052] When the user needs to translate, he can start the translation application or translation tool in the terminal, enter the translation interface, enter the original text in the original text editing area of ​​the translation interface, and set the translation language corresponding to the translation; then perform the translation operation, that is, you can view the translation of the translation language corresponding to the translation of the original text; of course, after the user has entered the original text and set the translation language, he can also directly view the translation of the translation language corresponding to the translation of the original text without performing the translation operation; the embodiment of the present invention does not limit this. Among them, the translation application can refer to an application that can provide translation services. Each time the translation application or translation tool is restarted to enter the translation interface, the width of the original text editing area and the translation display area in the translation interface can be the default value, or the width value after the last width adjustment; the embodiment of the present invention does not limit this. In addition, the default value of the width of the original text editing area and the default value of the width of the translation display area can be the same or different, and the embodiment of the present invention does not limit this.

[0053] After determining that the user needs to translate the original text, on the one hand, the translation application or translation tool can determine the original language corresponding to the original text, and determine the target language of the target text corresponding to the original text, and then adjust the width of the original text editing area and the target text display area according to the original language and the target language. On the other hand, the translation application or translation tool can translate the original text in the original text editing area to obtain the target text corresponding to the target language; and then display the target text in the target text display area for the user to view.

[0054] In an embodiment of the present invention, a method for adjusting the width of the original text editing area and the translation display area according to the original text language and the translation language can refer to steps 204 to 206:

[0055] Step 204: Determine matching preset ratio information based on the source language and the target language.

[0056] Step 206: adjusting the width of the original text editing area and the width of the translation display area in the translated interface according to the matched preset ratio information, and displaying the translated text in the translation display area.

[0057] In an embodiment of the present invention, the preset ratio information corresponding to any two languages ​​can be predetermined, and the preset ratio information between any two languages ​​can be determined based on the height ratio of texts expressing the same content in the two languages ​​when displayed in the same display style in a preset area. Wherein, the display style may include: font size, character spacing, line spacing and paragraph spacing, and the same display style may refer to the same font size, character spacing, line spacing and paragraph spacing. For example, the height of Chinese text displayed in the preset area according to display style 1 is X1, and the height of English text expressing the same content as the Chinese text (such as the English translation corresponding to the Chinese text) is X2 when displayed in the area according to display style 1, then the preset ratio information corresponding to Chinese-English can be X1 / X2.

[0058] Correspondingly, the display styles of the original text editing area and the translation display area in the translation interface are also the same, and are the same as the display style of the preset area; and subsequently, the widths of the original text editing area and the translation display area can be adjusted according to the preset ratio information, so that the heights of the original text in the adjusted original text editing area and the translated text in the translation display area after the width adjustment can be adjusted to be the same, thereby avoiding confusion between the original text and the translated text.

[0059] In the embodiment of the present invention, according to the original language and the target language, preset ratio information matching the original language and the target language can be searched from the pre-stored preset ratio information; then, according to the matching preset ratio information, the width of the original editing area and the width of the target display area are adjusted. And the translated text is displayed in the target display area for easy reference by the user.

[0060] In one example of the present invention, a user enters Chinese text in the original text editing area of ​​the translation interface such as Figure 3a As shown in the left area in the middle, after setting the translation language to English and performing the translation operation; the translation application or translation tool can determine the original language (Chinese) corresponding to the translated original text in the original text editing area in the translation interface and the translation language (English) of the translated text corresponding to the translated original text; then determine the matching preset ratio information based on the original language and the translation language, for example, the preset ratio information corresponding to Chinese-English is 1:1.40, and the matching preset ratio information can be determined to be 1:1.40; then adjust the width of the original text editing area and the width of the translated text display area in the translated interface based on the matching preset ratio information, and display the translated text in the translation display area as shown in FIG. Figure 3a As shown in the right area of ​​the middle, it can be seen that the original translation text (Chinese) in the original text editing of the translation interface and the translated translation text (English) in the translated text display area can be compared with each other.

[0061] In one example of the present invention, a user enters Chinese text in the original text editing area of ​​the translation interface such as Figure 3b As shown in the left area in the middle, after setting the translation language to Arabic and performing the translation operation; the translation application or translation tool can determine the original language (Chinese) corresponding to the translated original text in the original text editing area in the translation interface and the translation language (Arabic) corresponding to the translated original text in the translation display area; then determine the matching preset ratio information based on the original language and the translation language, for example, the preset ratio information corresponding to Chinese-Arabic is 1:0.91, and the matching preset ratio information can be determined to be 1:0.91; then adjust the width of the original text editing area and the width of the translation display area in the translated interface based on the matching preset ratio information, and display the translated text in the translation display area as shown in FIG. Figure 3b As shown in the right area of ​​the middle, it can be seen that the original translation text (Chinese) in the original text editing of the translation interface and the translated translation text (Arabic) in the translated text display area can be compared with each other.

[0062] In one example of the present invention, a user enters Chinese text in the original text editing area of ​​the translation interface such as Figure 3c As shown in the left area in the middle, after setting the translation language to Japanese and performing the translation operation; the translation application or translation tool can determine the original language (Chinese) corresponding to the translated original text in the original text editing area in the translation interface and the translation language (Japanese) corresponding to the translated original text in the translation display area; then determine the matching preset ratio information based on the original language and the translation language, for example, the preset ratio information corresponding to Chinese-Arabic is 1:1.22, and the matching preset ratio information can be determined to be 1:1.22; then adjust the width of the original text editing area and the width of the translation display area in the translated interface based on the matching preset ratio information, and display the translated text in the translation display area as shown in FIG. Figure 3c As shown in the right area of ​​the middle, it can be seen that the original translation text (Chinese) in the original text editing of the translation interface and the translated translation text (Japanese) in the translated text display area can be compared with each other.

[0063] In summary, in the embodiment of the present invention, the original language of the translated original text in the original text editing area of ​​the translation interface and the translation language of the translated text corresponding to the translated original text can be determined, and then the matching preset ratio information is determined according to the original text language and the translation language, and then the width of the original text editing area and the width of the translated text display area in the translated interface are adjusted according to the matching preset ratio information, and the translated text is displayed in the translated text display area; and then the height of the translated original text in the adjusted original text editing area and the translated text in the translated text display area after the width is adjusted can be adjusted to be equal, so as to avoid confusion between the translated original text and the translated text.

[0064] In the embodiment of the present invention, there are multiple ways to predetermine the preset ratio information. One way to determine the preset ratio information can refer to steps 402-406:

[0065] Reference Figure 4 , showing a step flow chart of an embodiment of a method for determining preset ratio information of the present invention.

[0066] Step 402: Translate a reference translation original text in one language into reference translation translated texts in multiple other languages.

[0067] Step 404: record the original text height of the reference translation text in the preset area, and record the translation height of the reference translation texts in other languages ​​in the preset area.

[0068] Step 406: Determine preset ratio information between the language and other languages ​​according to the ratio between the original text height and each translated text height.

[0069] In the embodiment of the present invention, for any two languages, the preset ratio information corresponding to the two languages ​​can be determined based on the height ratio of texts expressing the same content in the two languages ​​when displayed in the preset area in the same display style.

[0070] In one implementation of the present invention, a translation text in one language may be selected as a reference translation text, and then the reference translation text in this language may be translated into reference translation texts in multiple other languages; then, based on the original text height of the reference translation text in this language in a preset area and the translation heights in various other language preset areas, the corresponding preset ratio information between this language and various other languages ​​may be determined. The reference translation text in one language may include multiple sentences.

[0071] In one implementation of the present invention, the reference translation text of the language can be translated into a reference translation text of another language each time, and then the original text height of the reference translation text in the preset area is recorded, as well as the translation height of the reference translation text of the other language in the preset area. For example, taking the translation of the reference translation text of Chinese into reference translation texts of multiple other languages ​​as an example, the height of the reference translation text of Chinese in the preset area is recorded as 378px, such as Figure 5a As shown; (1) Translate the Chinese reference translation into the Arabic reference translation, and record the Arabic reference translation in the preset area as 344px high, such as Figure 5b (2) Translate the Chinese reference translation into the Japanese reference translation, and record the Japanese reference translation in a preset area with a height of 463px, as shown in FIG. Figure 5c(3) Translate the Chinese reference translation into the English reference translation, and record the height of the English reference translation in the preset area as 531px, as shown in Figure 5d shown.

[0072] Then, the ratio of the original text height to the translation height corresponding to various other languages ​​is calculated respectively, and the preset ratio information corresponding to the language and various other languages ​​is determined according to the calculated ratio; wherein, one implementation method may be to use the calculated ratio as the preset ratio information corresponding to the language and the other languages ​​corresponding to the ratio. wherein, in the process of calculating the ratio of the original text height to the translation height corresponding to various other languages, the original text height can be mapped to 1 as a benchmark, and the translation height corresponding to various other languages ​​can be mapped to the corresponding mapping value, and then the ratio of the mapping value 1 of the original text height to the mapping value of the translation height corresponding to various other languages ​​is calculated respectively. for example, based on the above example, with the reference translation original text corresponding to Chinese in the preset area of ​​378px mapped to 1 as a benchmark, the height of the Arabic reference translation in the preset area of ​​344px can be mapped to 0.91, the height of the Japanese reference translation in the preset area of ​​463px can be mapped to 1.22, and the height of the English reference translation in the preset area of ​​531px can be mapped to 1.40. Then, the ratio of the mapping value 1 of the original text height corresponding to Chinese and the mapping value 0.91 of the translation height corresponding to Arabic is calculated to be 1:0.91, and the corresponding preset ratio information between Chinese and Arabic is 1:0.19; by analogy, the corresponding preset ratio information between Chinese and Japanese is 1:1.22, and the corresponding preset ratio information between Chinese and English is 1:1.40.

[0073] In another embodiment of the present invention, another way to determine the preset ratio information may be to extract samples based on statistical methods and calculate the preset ratio information between different languages, thereby improving the accuracy of the preset ratio information.

[0074] The following is an example of calculating the preset ratio information between a language pair by extracting samples based on a statistical method.

[0075] Reference Figure 6 , showing a step flow chart of an optional embodiment of a method for determining preset ratio information of the present invention.

[0076] Step 602: for a language pair, extract multiple groups of samples corresponding to the language pair according to a statistical method, where a group of samples includes samples of two languages ​​with the same expression content, and a sample of one language is a sentence.

[0077] Step 604: determining a first cumulative height of the multiple samples of one language in the preset area, and determining a second cumulative height of the multiple samples of another language in the preset area;

[0078] Step 606: Determine preset ratio information corresponding to the language pair according to the ratio of the first cumulative height to the second cumulative height.

[0079] In the embodiment of the present invention, for the convenience of subsequent description, the two languages ​​in the language pair may be referred to as language 1 and language 2, respectively.

[0080] In the embodiment of the present invention, the word length of the text to be translated by the user follows a normal distribution, so a normal distribution sampling method can be used to determine the number of groups of samples that need to be collected; wherein a group of samples includes a sample of language 1 and a sample of language 2, a sample of language 1 can be a text of language 1 corresponding to a sentence, and can be a sentence, and a sample of language 2 can be a sample of language 1 translated into a translation text corresponding to language 2.

[0081] The number of sample groups to be collected can be determined by determining the number of samples of language 1 or the number of samples of language 2. The following is an explanation of determining the number of samples of language 1:

[0082] In the embodiment of the present invention, a reference value X of the number of words in a sample of language 1, a maximum deviation D, a confidence level P and a variance E can be set; then the number of samples N of language 1 is determined according to the reference value X of the number of words, the maximum deviation D, the confidence level P and the variance E. In one example, the expression of N can be: N = (X a / 2 ) 2 *E / D 2 .

[0083] For example, if the maximum deviation D = 10 and the confidence level P = 0.95, we can get X according to the normal distribution table. a / 2 =1.96, and then N = 0.038416*E. The range (ie, R = x) can be calculated from a preset number of samples of language 1 in the historical translation data. max -x min ), and then calculate E according to the formula E≈R / 6; wherein the preset number can be determined according to demand, such as 30 to 50. When the number of words in the sample of language 1 extracted from the historical translation data is small, D can be adjusted to reduce the jitter of the sample.

[0084] In addition, in one embodiment of the present invention, if the accuracy needs to be improved, the confidence level can be increased and / or the maximum deviation D can be reduced.

[0085] Then, N samples of language 1 can be extracted from the historical translation data, and the translations of these N samples of language 1 into language 2 can be extracted as N samples of language 2; wherein, a sample of language 1 and the corresponding sample of language 2 can form a group of samples.

[0086] Then, N samples of language 1 are added to the preset area, and the sum of the heights of the N samples in the preset area is determined (hereinafter referred to as the first cumulative height), and N samples of language 2 are added to the preset area, and the sum of the heights of the N samples in the preset area is determined (hereinafter referred to as the second cumulative height). In an embodiment of the present invention, the method of adding samples of language 1 to the preset area is the same as the method of adding samples of language 2, wherein one method of adding N samples of language 1 to the preset area may be to splice each sample at the end of the sentence of the previous sample in the preset area. Then, the ratio of the first cumulative height to the second cumulative height is calculated to obtain the corresponding preset ratio information between the language pairs.

[0087] In one embodiment of the present invention, after determining the corresponding preset ratio information between any two languages, a corresponding mapping relationship can be established, so that in the subsequent translation process, the mapping relationship can be searched according to the language of the original text and the language of the translated text, and the matching preset ratio information can be determined. Wherein, the mapping relationship can include the relationship between the original language identifier, the translated text language identifier and the preset ratio information, the original language identifier can refer to the identifier of the language corresponding to the former item in the preset ratio information, and the translated text language identifier can refer to the identifier of the language corresponding to the latter item in the preset ratio information; correspondingly, any two languages ​​can correspond to two mapping relationships.

[0088] In an optional embodiment of the present invention, N groups of samples corresponding to the language pair can be selected from historical translation data in different fields, and the corresponding preset ratio information between the two languages ​​of the language pair in each field can be determined based on the N groups of samples. Correspondingly, any mapping relationship can include: the relationship between the field identifier, the original language identifier, the translation language identifier and the preset ratio information. Therefore, in the translation process, the field to which the original text is translated can be determined, and matching preset ratio information can be found from the preset ratio information of the field to improve the accuracy of width adjustment.

[0089] Reference Figure 7 , shows a flow chart of steps of an optional embodiment of a region adjustment method of the present invention, which may specifically include the following steps:

[0090] Step 702: Determine the original language of the translated text in the original text editing area of ​​the translation interface and the target language of the target text corresponding to the translated text.

[0091] Step 704: searching for a mapping relationship based on the source language and the target language to determine matching preset ratio information.

[0092] In an embodiment of the present invention, after the user enters the translation interface, the user can set the original language and then enter the translated original text in the original text editing area of ​​the translation interface. Alternatively, the user can directly enter the translated original text in the original text editing area of ​​the translation interface without setting the original language. The embodiment of the present invention does not limit this. Correspondingly, the embodiment of the present invention may include multiple ways to determine the original language of the translated original text in the original text editing area. One implementation method may be to obtain the language setting information of the translated original text set by the user for the translated original text, and determine the original language of the translated original text according to the language setting information corresponding to the translated original text. Another method may be to obtain the translated original text entered by the user in the original text editing area, perform language detection on the translated original text, and obtain the original language corresponding to the translated original text. Of course, the two methods may also be combined to determine the original language of the translated original text. And the language setting information of the translated translation set by the user for the translated translation may be obtained, and the language corresponding to the language setting information of the translated translation may be determined as the translated translation language of the translated translation.

[0093] Wherein, if the predetermined mapping relationship includes: the relationship between the original language identifier, the target language identifier and the preset ratio information, the identifier of the original language corresponding to the translated original text can be compared with the original language identifier in each mapping relationship, and the identifier of the target language corresponding to the translated text can be compared with the target language identifier in each mapping relationship. When the original language identifier in a mapping relationship matches the identifier of the original language corresponding to the translated original text, and the target language identifier matches the identifier of the target language corresponding to the translated text, the mapping relationship can be determined to be a matching mapping relationship, and the preset ratio information in the mapping relationship can be determined as the preset ratio information matching the original language and the target language.

[0094] Wherein, if the predetermined mapping relationship includes: the relationship between the domain identifier, the original language identifier, the target language identifier and the preset ratio information, the embodiment of the present invention can also analyze the domain corresponding to the translated original text, and then search the mapping relationship between the original language and the target language according to the identifier of the domain corresponding to the translated original text, and determine the matching preset ratio information. Wherein, the identifier of the domain corresponding to the translated original text can be compared with the domain identifier in each mapping relationship, the identifier of the original language corresponding to the translated original text can be compared with the original language identifier in each mapping relationship, and the identifier of the target language corresponding to the translated text can be compared with the target language identifier in each mapping relationship; when the domain identifier in a mapping relationship matches the identifier of the domain corresponding to the translated original text, and the original language identifier matches the identifier of the original language corresponding to the translated original text, and the target language identifier matches the identifier of the target language corresponding to the translated text, the mapping relationship can be determined to be a matching mapping relationship.

[0095] Step 706: Obtain the total width of the original text editing area and the translation display area in the translation interface.

[0096] Step 708: According to the matched preset ratio information and the total width, the width of the original text editing area and the width of the translation display area are adjusted, and the translated text is displayed in the translation display area.

[0097] In an embodiment of the present invention, the sum of the widths of the original text editing area and the translation display area in the translation interface (hereinafter referred to as the total width) may be limited, so the width of the original text editing area and the width of the translation display area may be adjusted based on the total width of the original text editing area and the translation display area. In an embodiment of the present invention, the total width of the original text editing area and the translation display area in the translation interface may be determined, and then the width of the original text editing area and the width of the translation display area may be adjusted based on the matching preset ratio information and the total width, and the following sub-steps may be referred to:

[0098] Sub-step 22: Calculate a first target width corresponding to the original text editing area and a second target width corresponding to the translation display area according to the matched preset ratio information and the total width.

[0099] Sub-step 24: adjusting the width of the original text editing area to a first target width, and adjusting the width of the translated text display area to a second target width.

[0100] In the embodiment of the present invention, since the display styles of the original text editing area and the translation display area are the same, in order to ensure that the height of the translated original text in the original text editing area and the translated text in the translation display area are the same, the width ratio of the original text editing area and the translation display area can be set to the inverse of the preset ratio information to calculate the first target width corresponding to the original text editing area and the second target width corresponding to the translation display area. For example, assuming that the first target width is A1, the second target width is A2, the total width is A, and the preset ratio information is K1:K2, the first target width information can be calculated as A1 and the second target width is A2 by the following formula:

[0101] A1+A2=A

[0102] A1:A2=K2:K1

[0103] Among them, A and K1:K2 are known numbers, and the values ​​of A1 and A2 can be obtained.

[0104] For example, the total width is A=1000px, and the preset ratio information is K1:K2=1:1.22, then A1=550px and A2=450px can be obtained.

[0105] Furthermore, the width of the original text editing area can be adjusted to match the first target width, and the width of the translated text display area can be adjusted to match the second target width, wherein the width of the original text editing area can be adjusted to the first target width, and the width of the translated text display area can be adjusted to the second target width.

[0106] In the embodiment of the present invention, the translation may be displayed in the translation display area first, and then the width of the translation display area may be adjusted; or the translation may be displayed in the translation display area after the width of the translation display area is adjusted; or the translation may be displayed during the process of adjusting the width of the translation display area, and the embodiment of the present invention does not limit this.

[0107] In the embodiment of the present invention, since the translated original text already exists in the original text editing area before the width is adjusted, during the process of adjusting the width of the original text editing area, the translated original text in the original text editing area can be rearranged according to the width of the adjusted original text editing area, so that the translated original text is adapted to the width of the original text editing area after the width is adjusted.

[0108] In an optional embodiment of the present invention, the width of the original text editing area and the translated text display may not be changed, but the font size of the translated original text in the original text editing area and / or the font size of the translated text in the translated text display area may be adjusted to achieve the unification of the height of the translated original text and the height of the translated text, thereby avoiding misalignment of the comparison. After determining that the translated original text corresponds to the translated text and displaying the translated text in the translated text display area, the height of the translated original text in the original text editing area may be compared with the height of the translated text in the translated text display area; then the unification of the height of the translated original text and the height of the translated text may be achieved by at least one of the following methods: keeping the font size of the translated original text unchanged and adjusting the font size of the translated text; keeping the font size of the translated text unchanged and adjusting the font size of the translated original text; adjusting the font size of the translated original text and the font size of the translated text at the same time; the embodiments of the present invention are not limited to this.

[0109] In an embodiment of the present invention, a method of keeping the font size of the original translation unchanged and adjusting the font size of the translated text may be as follows: when the height of the original translation is greater than the height of the translated text, the font size of the translated text may be increased; wherein, the font size of the translated text may be increased according to a first set step length each time, and then the height of the original translation is compared with the height of the translated text after the font size is increased to determine whether it is necessary to continue to increase the font size of the translated text. When the height of the original translation is greater than the height of the translated text after the font size is increased, it is determined that the font size of the translated text needs to be continued to be increased, and at this time, the font size of the translated text may continue to be increased according to the first set step length. When the height of the original translation is less than the height of the translated text after the font size is increased, the font size of the translated text may be stopped from being adjusted, or the font size of the translated text may be reduced according to a second set step length, wherein the second set step length is less than the first set step length, and both the first set step length and the second set step length may be set as required, and the embodiment of the present invention does not limit this. After the font size of the translated text is reduced according to the second set step size, the height of the translated text can be compared with the height of the translated text after the font size is reduced to determine whether the font size of the translated text needs to be further reduced. When the height of the translated text is less than the height of the translated text after the font size is reduced, the font size of the translated text can continue to be reduced according to the second set step size; when the height of the translated text is greater than the height of the translated text after the font size is reduced, the font size of the translated text can be stopped from being adjusted; and so on. Of course, other methods can also be used for adjustment, and the embodiments of the present invention do not limit this. Among them, the method of keeping the font size of the translated text unchanged and adjusting the font size of the translated text is similar to the above-mentioned method of keeping the font size of the translated text unchanged and adjusting the font size of the translated text, and will not be repeated here.

[0110] In an embodiment of the present invention, a method for adjusting the font size of the original translation and the font size of the translated text at the same time may be that when the height of the original translation is greater than the height of the translated text, the font size of the translated text may be increased and the font size of the original translation may be reduced; wherein, the font size of the translated text may be increased according to a third set step size each time, and the font size of the original translation may be reduced according to the third set step size each time, until the height of the original translation and the translated text after the font size adjustment is unified. Wherein, the third set step size may be set as required, and the embodiment of the present invention does not limit this. When the height of the original translation is less than the height of the translated text, the font size of the translated text may be reduced and the font size of the original translation may be increased; wherein, the font size of the translated text may be reduced according to the third set step size each time, and the font size of the original translation may be increased according to the third set step size each time, until the height of the original translation and the translated text after the font size adjustment is unified. Of course, other methods may also be used for adjustment, and the embodiment of the present invention does not limit this.

[0111] In an optional embodiment of the present invention, after changing the width of the original text editing area and the translation display, or adjusting the font size of the translated original text and / or the translated text, when the user needs to further view the translated text, a viewing operation such as a click operation can be performed on the translated text. The corresponding translation application or translation tool can receive the corresponding viewing instruction, then enlarge the translated text and display it in a pop-up window.

[0112] In summary, in the embodiment of the present invention, the original language of the translated original text in the original text editing area of ​​the translation interface and the translation language of the translated text corresponding to the translated original text can be determined, and then the matching preset ratio information is determined based on the original language and the translated text language, and then the width of the original text editing area and the width of the translated text display area in the translation interface are adjusted based on the matching preset ratio information, and the translated text is displayed in the translated text display area; and then the height of the translated original text in the adjusted original text editing area and the translated text in the translated text display area after the width is adjusted can be adjusted to the same height, thereby avoiding confusion between the translated original text and the translated text. And when the translated original text is a large piece of information, the effect of avoiding confusion between the translated original text and the translated text in the embodiment of the present invention is particularly obvious.

[0113] Secondly, in an embodiment of the present invention, the total width of the original text editing area and the translation display area in the translation interface can be obtained, and then the first target width corresponding to the original text editing area and the second target width corresponding to the translation display area are calculated according to the preset ratio information of the matching and the total width; the width of the original text editing area is adjusted to the first target width, and the width of the translation display area is adjusted to the second target width; and then the widths of the original text editing area and the translation display area are adjusted while ensuring that the total widths of the original text editing area and the translation display area remain unchanged, and thus there is no need to rearrange other elements in the translation interface, which is highly practical and easy to operate.

[0114] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0115] Reference Figure 8 , shows a structural block diagram of an embodiment of a region adjustment device of the present invention, which may specifically include the following modules:

[0116] A language determination module 802 is used to determine the original language of the translated original text in the original text editing area of ​​the translation interface, and the target language of the target text corresponding to the translated original text;

[0117] A ratio determination module 804, configured to determine matching preset ratio information according to the source language and the target language;

[0118] The area adjustment module 806 is used to adjust the width of the original text editing area and the width of the translation display area in the translation interface according to the matched preset ratio information, and display the translated text in the translation display area.

[0119] Reference Fig. 9 , showing a structural block diagram of an optional embodiment of a region adjustment device of the present invention.

[0120] In an optional embodiment of the present invention, the region adjustment module 806 includes:

[0121] The width acquisition submodule 8062 is used to acquire the total width of the original text editing area and the translation display area in the translation interface;

[0122] The width adjustment submodule 8064 is used to adjust the width of the original text editing area and the width of the translation display area according to the matched preset ratio information and the total width.

[0123] In an optional embodiment of the present invention, the width adjustment submodule 8064 is used to calculate the first target width corresponding to the original text editing area and the second target width corresponding to the translation display area based on the matched preset ratio information and the total width; adjust the width of the original text editing area to the first target width, and adjust the width of the translation display area to the second target width.

[0124] In an optional embodiment of the present invention, the ratio determination module 804 is used to search for a mapping relationship based on the source language and the target language to determine matching preset ratio information.

[0125] In an optional embodiment of the present invention, the device further comprises:

[0126] The first ratio information determination module 808 is used to translate a reference translation text in one language into reference translation texts in multiple other languages ​​respectively; record the original text height of the reference translation text in a preset area, and record the translation height of each reference translation text in the preset area; determine the preset ratio information between the language and each other language based on the ratio of the original text height to the translation height; wherein the preset area, the original text editing area and the translation display area have the same display style, and the reference translation text includes multiple sentences.

[0127] In an optional embodiment of the present invention, the device further comprises:

[0128] The second ratio information determination module 810 is used to extract multiple groups of samples corresponding to a language pair according to a statistical device, where one group of samples includes samples of two languages ​​with the same expression content, and a sample of one language is a sentence; determine a first cumulative height of multiple samples of one language in a preset area, and determine a second cumulative height of multiple samples of another language in the preset area; determine the preset ratio information corresponding to the language pair according to the ratio of the first cumulative height to the second cumulative height; wherein the preset area, the original text editing area and the translation display area have the same display style.

[0129] In an optional embodiment of the present invention, the same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

[0130] In summary, in the embodiment of the present invention, the original language of the translated original text in the original text editing area of ​​the translation interface and the translation language of the translated text corresponding to the translated original text can be determined, and then the matching preset ratio information is determined according to the original text language and the translation language, and then the width of the original text editing area and the width of the translated text display area in the translated interface are adjusted according to the matching preset ratio information, and the translated text is displayed in the translated text display area; and then the height of the translated original text in the adjusted original text editing area and the translated text in the translated text display area after the width is adjusted can be adjusted to be equal, so as to avoid confusion between the translated original text and the translated text.

[0131] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0132] Fig.10 1 is a block diagram of an electronic device 1000 for region adjustment according to an exemplary embodiment. For example, the electronic device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0133] Reference Fig.10 , the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .

[0134] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.

[0135] The memory 1004 is configured to store various types of data to support operations on the device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0136] The power component 1006 provides power to various components of the electronic device 1000. The power component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1000.

[0137] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0138] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.

[0139] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0140] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the device 1000, the relative positioning of the components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of contact between the user and the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0141] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1014 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1014 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0142] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0143] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0144] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a region adjustment processing method, the method comprising: determining the original language of a translated original text in an original text editing area of ​​a translation interface, and the target language of a translated text corresponding to the translated original text; determining matching preset ratio information based on the original text language and the target language; adjusting the width of the original text editing area and the width of a translated text display area in the translation interface based on the matching preset ratio information, and displaying the translated text in the translated text display area.

[0145] Optionally, adjusting the width of the original text editing area and the width of the translated text display area in the translation interface according to the matching preset ratio information includes: obtaining the total width of the original text editing area and the translated text display area in the translation interface; and adjusting the width of the original text editing area and the width of the translated text display area according to the matching preset ratio information and the total width.

[0146] Optionally, adjusting the width of the original text editing area and the width of the translated text display area based on the matched preset ratio information and the total width includes: calculating a first target width corresponding to the original text editing area and a second target width corresponding to the translated text display area based on the matched preset ratio information and the total width; adjusting the width of the original text editing area to the first target width, and adjusting the width of the translated text display area to the second target width.

[0147] Optionally, the determining matching preset ratio information according to the source language and the target language includes: searching for a mapping relationship based on the source language and the target language to determine the matching preset ratio information.

[0148] Optionally, the method further includes the step of determining preset ratio information: translating a reference translation text in one language into reference translation texts in multiple other languages ​​respectively; recording the original text height of the reference translation text in a preset area, and recording the translation height of each reference translation text in the preset area; determining the preset ratio information between the language and each other language based on the ratio of the original text height to the translation height; wherein the preset area, the original text editing area and the translation display area have the same display style, and the reference translation text includes multiple sentences.

[0149] Optionally, the method further includes the step of determining preset ratio information: for a language pair, extracting multiple groups of samples corresponding to the language pair based on a statistical method, wherein a group of samples includes samples of two languages ​​expressing the same content, and a sample of one language is a sentence; determining a first cumulative height of multiple samples of one language in a preset area, and determining a second cumulative height of multiple samples of another language in the preset area; determining the preset ratio information corresponding to the language pairs based on the ratio of the first cumulative height to the second cumulative height; wherein the preset area, the original text editing area and the translation display area have the same display style.

[0150] Optionally, the same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

[0151] Fig.11 1 is a schematic diagram of the structure of an electronic device 1100 for regional adjustment according to another exemplary embodiment of the present invention. The electronic device 1100 may be a server, which may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1122 (for example, one or more processors) and a memory 1132, and one or more storage media 1130 (for example, one or more mass storage devices) storing application programs 1142 or data 1144. Among them, the memory 1132 and the storage medium 1130 may be short-term storage or permanent storage. The program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processor 1122 may be configured to communicate with the storage medium 1130 and execute a series of instruction operations in the storage medium 1130 on the server.

[0152] The server may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, one or more keyboards 1156, and / or, one or more operating systems 1141, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0153] An electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: determining the original language of a translated original text in an original text editing area of ​​a translation interface and the target language of a translated text corresponding to the translated original text; determining matching preset ratio information based on the original text language and the target language; adjusting the width of the original text editing area and the width of a target text display area in the translation interface based on the matching preset ratio information, and displaying the translated text in the target text display area.

[0154] Optionally, adjusting the width of the original text editing area and the width of the translated text display area in the translation interface according to the matching preset ratio information includes: obtaining the total width of the original text editing area and the translated text display area in the translation interface; and adjusting the width of the original text editing area and the width of the translated text display area according to the matching preset ratio information and the total width.

[0155] Optionally, adjusting the width of the original text editing area and the width of the translated text display area based on the matched preset ratio information and the total width includes: calculating a first target width corresponding to the original text editing area and a second target width corresponding to the translated text display area based on the matched preset ratio information and the total width; adjusting the width of the original text editing area to the first target width, and adjusting the width of the translated text display area to the second target width.

[0156] Optionally, the determining matching preset ratio information according to the source language and the target language includes: searching for a mapping relationship based on the source language and the target language to determine the matching preset ratio information.

[0157] Optionally, it also includes instructions for performing the following operations to determine preset ratio information: translating a reference translation text in one language into reference translation texts in multiple other languages ​​respectively; recording the original text height of the reference translation text in a preset area, and recording the translation height of each reference translation text in the preset area; determining the preset ratio information between the language and each other language based on the ratio of the original text height to the translation height; wherein the preset area, the original text editing area and the translation display area have the same display style, and the reference translation text includes multiple sentences.

[0158] Optionally, the method further includes instructions for performing the following operations of determining preset ratio information: for a language pair, extracting multiple groups of samples corresponding to the language pair based on a statistical electronic device, wherein a group of samples includes samples of two languages ​​with the same expression content, and a sample of one language is a sentence; determining a first cumulative height of multiple samples of one language in a preset area, and determining a second cumulative height of multiple samples of another language in the preset area; determining the corresponding preset ratio information between the language pairs based on the ratio of the first cumulative height to the second cumulative height; wherein the preset area, the original text editing area and the translation display area have the same display style.

[0159] Optionally, the same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

[0160] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0161] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0164] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0165] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0166] The above is a detailed introduction to a region adjustment method, a region adjustment device and an electronic device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A region adjustment method, characterized in that: include: Determine the original language of the translated original text in the original text editing area of ​​the translation interface, and the target language of the target text corresponding to the translated original text; Determining matching preset ratio information according to the source language and the target language; Adjusting the width of the original text editing area and the width of the translation display area in the translation interface according to the matched preset ratio information, and displaying the translated text in the translation display area; The step of determining the preset ratio information: Translate a reference translation source text in one language into reference translations in multiple other languages; Recording the original text height of the reference translation text in the preset area, and recording the translation height of the reference translation texts in other languages ​​in the preset area; According to the ratio of the original text height to the height of each translation text, the preset ratio information between the language and each other language is determined; wherein the display styles of the preset area, the original text editing area and the translation display area are the same, and the reference translation original text includes multiple sentences; Or, for a language pair, multiple groups of samples corresponding to the language pair are extracted according to a statistical method, wherein one group of samples includes samples of two languages ​​expressing the same content, and the sample of one language is a sentence; a first cumulative height of multiple samples of one language in a preset area is determined, and a second cumulative height of multiple samples of another language in a preset area is determined; based on the ratio of the first cumulative height to the second cumulative height, the corresponding preset ratio information between the language pairs is determined; wherein the display styles of the preset area, the original text editing area and the translation display area are the same.

2. The method according to claim 1, characterized in that The adjusting the width of the original text editing area and the width of the translated text display area in the translation interface according to the matched preset ratio information includes: Obtaining the total width of the original text editing area and the translation display area in the translation interface; The width of the original text editing area and the width of the translated text display area are adjusted according to the matched preset ratio information and the total width.

3. The method according to claim 2, characterized in that The adjusting the width of the original text editing area and the width of the translation display area according to the matched preset ratio information and the total width includes: Calculating a first target width corresponding to the original text editing area and a second target width corresponding to the translation display area according to the matched preset ratio information and the total width; The width of the original text editing area is adjusted to the first target width, and the width of the translated text display area is adjusted to the second target width.

4. The method according to claim 1, characterized in that: The step of determining matching preset ratio information based on the source language and the target language includes: A mapping relationship is searched based on the source language and the target language to determine matching preset ratio information.

5. The method according to claim 1, characterized in that The same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

6. A region adjustment device, characterized in that: include: A language determination module, used to determine the original language of the translated original text in the original text editing area of ​​the translation interface, and the target language of the target text corresponding to the translated original text; A ratio determination module, used to determine matching preset ratio information according to the source language and the target language; An area adjustment module, used for adjusting the width of the original text editing area and the width of the translation display area in the translation interface according to the matched preset ratio information, and displaying the translated text in the translation display area; The ratio determination module is specifically used to translate a reference translation original text in one language into reference translation texts in multiple other languages ​​respectively; Recording the original text height of the reference translation text in the preset area, and recording the translation height of the reference translation texts in other languages ​​in the preset area; According to the ratio of the original text height to the height of each translation text, the preset ratio information between the language and each other language is determined; wherein the display styles of the preset area, the original text editing area and the translation display area are the same, and the reference translation original text includes multiple sentences; Or, for a language pair, multiple groups of samples corresponding to the language pair are extracted based on a statistical device, where one group of samples includes samples of two languages ​​with the same expression content, and the sample of one language is a sentence; a first cumulative height of multiple samples of one language in a preset area is determined, and a second cumulative height of multiple samples of another language in a preset area is determined; based on the ratio of the first cumulative height to the second cumulative height, the corresponding preset ratio information between the language pairs is determined; wherein the display styles of the preset area, the original text editing area and the translation display area are the same.

7. The device according to claim 6, characterized in that The area adjustment module includes: A width acquisition submodule, used to acquire the total width of the original text editing area and the translation display area in the translation interface; The width adjustment submodule is used to adjust the width of the original text editing area and the width of the translation display area according to the matched preset ratio information and the total width.

8. The device according to claim 6, characterized in that The width adjustment submodule is used to calculate a first target width corresponding to the original text editing area and a second target width corresponding to the translation display area according to the matched preset ratio information and the total width; The width of the original text editing area is adjusted to the first target width, and the width of the translated text display area is adjusted to the second target width.

9. The device according to claim 6, characterized in that The ratio determination module is used to search for a mapping relationship based on the source language and the target language to determine matching preset ratio information.

10. The device according to claim 6, characterized in that The same display style includes: the same character spacing, the same line spacing, the same paragraph spacing and the same font size.

11. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the area adjustment method as described in any one of method claims 1-5.

12. An electronic device, characterized in that: The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to execute the area adjustment method as claimed in any one of method claims 1 to 5.