Combined word limited position line splitting processing method

By constructing a combined vocabulary and presetting the line disassembly position according to the semantic structure of the combined vocabulary, the problem of inaccurate line disassembly processing in the prior art is solved, and the accuracy and readability of text typesetting are improved.

CN119903836AActive Publication Date: 2025-04-29WEIFANG BEIDA JADE BIRD HUAGUANG IMAGESETTER
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510368657.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-04-29
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

The existing text layout and line disassembly algorithm fails to fully consider the semantic integrity of combined words and the need to split lines in specific limited positions, resulting in the accuracy and readability requirements of text layout when processing text containing combined words.

Method used

The method of decomposing the line by using the combined word limit position is used to construct a combination lexicon library, collect and analyze the semantic structure of the combined word, preset the decomposing position, and accurately judge and determine the decomposing position based on the position and decomposing position information of the combined word during text layout.

Benefits of technology

It improves the accuracy and readability of text typesetting, avoids semantic ambiguity or understanding difficulties caused by unlimited positions of combined words, and is suitable for scenarios with high requirements for text normability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903836A_ABST
    Figure CN119903836A_ABST
Patent Text Reader

Abstract

The invention discloses a combined word limited position line splitting processing method. The method comprises the following steps: step 1, constructing a combined word bank; 2, obtaining a to-be-judged text; and step 3, judging a line splitting position, and executing line splitting processing. The text typesetting method has the advantages that the text can be accurately subjected to line splitting processing according to the preset limiting positions of the combined words, and the accuracy and readability of text typesetting are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text processing, and particularly relates to a method for splitting lines with restricted positions for combined words. Background Art

[0002] During the text layout process, especially for texts containing specific combined words, reasonable line splitting processing is crucial. For example, for a combined word like "Xinjiang Uygur Autonomous Region", if it is randomly split, it may lead to difficulties in semantic understanding and even ambiguity. Currently, most common text layout line splitting algorithms are mainly processed based on punctuation mark exclusion rules, without fully considering the semantic integrity of combined words and the need for splitting lines at specific restricted positions, resulting in the inability to meet the requirements for text layout accuracy and readability in practical applications when processing texts containing such combined words. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method for splitting lines with restricted positions for combined words, which can accurately split lines of text according to the preset restricted positions of combined words, and improve the accuracy and readability of text layout.

[0004] To solve the above technical problems, the present invention adopts the following technical solutions: A method for splitting lines with restricted positions for combined words includes the following steps: Step 1, constructing a combined word library; Step 2, obtaining the text to be judged; Step 3, judging the line splitting position and performing line splitting processing. The said Step 1 includes the following steps: Step 1.1, collecting combined words; Step 1.2, semantic structure analysis and information setting; The said Step 3 includes the following steps: Step 3.1, initialization: initializing the starting position Ps = 0 for matching the character sequence of the text S to be judged; Step 3.2, combined word matching; Step 3.3, judging the line splitting position; Step 3.4, performing line splitting processing; Step 3.5, default line splitting; Step 3.6, completion of line splitting.

[0005] Further, the said Step 1.2 includes the following steps: For each collected compound word, deeply analyze its semantic structure, and determine a reasonable line-breaking position according to the semantic structure. At the same time, set the line-breaking position information of the compound word, and record the maximum length of the compound word, denoted as Lmax. The starting index value of the compound word library is index = 0. This step provides basic data support for subsequent text line-breaking to ensure that the line-breaking position conforms to the semantic logic of the compound word.

[0006] Further, step 2 includes the following steps: When the text to be processed needs to be line-broken at the end of a line, take Lmax - 1 characters from the end of the line forward, denoted as S1, and take Lmax - 1 characters backward, denoted as S2. Combine S1 + S2 to obtain the text to be judged S. At the same time, record the position of the end of the line in the text to be judged S, denoted as P0, where P0 = Lmax - 1. In this way, a text segment with appropriate length and including the end-of-line position information is obtained for matching and line-breaking position judgment in the compound word library.

[0007] Further, step 3.2 includes the following steps: Compound word matching: Determine whether the compound word index value index is equal to the length of the compound word library. If the compound word index value index is equal to the length of the compound word library, that is, the compound word library query is completed, then enter step 3.5; if the compound word index value index is less than the length of the compound word library, then take the word from index, record the taken word as the string to be matched W, and record the length of the string to be matched W as Lw. The compound word index value index is incremented by 1, that is, index = index + 1.

[0008] Further, step 3.3 includes the following steps: Starting from the matching start position Ps of the character sequence of the text to be judged S, compare the character sequence in the text to be judged S with the character sequence of the string to be matched W one by one in character order. If after traversing the entire text to be judged S, no character sequence that is exactly the same and continuous as the string to be matched W is found, it is determined that the match fails, and repeat step 3.1; when there is a character sequence in the text to be judged S that is exactly the same and continuous as the string to be matched W, it is determined that the match is successful, and record the position of the string to be matched W in the text to be judged S as P1. If P1 >= P0, that is, the entire word of the string to be matched W is after the end-of-line position, then repeat step 3.1. If P1 + Lw <= P0, that is, the entire word of the string to be matched W is before the end-of-line position, then set Ps to P1 + Lw and repeat step 3.3. At this time, the end-of-line position falls in the middle of the character sequence of the string to be matched W, that is, it satisfies P1 < P0 and P1 + Lw > P0. This step provides a basis for determining the line-breaking position by matching the position of the compound word in the text to be judged and judging the position of the end-of-line in the character sequence of the compound word.

[0009] Further, the step 3.4 includes the following steps: In the to-be-matched string W, search for the restricted line break position Pw in the to-be-matched string W from position P0-P1 forward; if the restricted line break position Pw is found, break the line from P1+Pw; if the restricted line break position Pw is not found, break the line from P1 and go to step 3.6; this step accurately judges and determines the final line break position based on the position of the compound word in the to-be-judged text, the position of the end of the line in the character sequence of the compound word, and the restricted line break position information of the compound word itself.

[0010] Further, the step 3.5 includes the following steps: Default line splitting: If no suitable line splitting basis is found after the combined vocabulary is searched, the line splitting will start from P0. This is the default line splitting method when there is no other better line splitting option.

[0011] The present invention adopts the above technical solution, and has the following technical effects compared with the prior art: Improve typesetting accuracy: By presetting the limited line-breaking position of compound words, semantic ambiguity or difficulty in understanding caused by line-breaking at non-limited positions of compound words is avoided, ensuring the accuracy of the text after typesetting.

[0012] Enhanced readability: Reasonable line breaking makes the text more in line with people's reading habits when presented, improving the readability of the text. It is especially suitable for scenarios with high requirements for text standardization, such as document typesetting, news release, etc.

[0013] Flexibility and scalability: The combined word library can be dynamically updated and expanded according to actual needs, and can adapt to the line splitting processing requirements of different fields and different types of combined words, with strong flexibility and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0015] Figure 1 A flow chart of a method for breaking a line at a limited position of a combination word; Figure 2 It is a schematic diagram of the combined vocabulary; Figure 3 To obtain a schematic diagram of the text to be judged; Figure 4 A schematic diagram of taking words from a combined vocabulary; Figure 5This is a schematic diagram for judging the position of the row removal; Figure 6 This is a schematic diagram showing the row dismantling process completed. DETAILED DESCRIPTION

[0016] Examples, such as Figure 1 As shown, a method for processing line breaking at a limited position of a combination word comprises the following steps: Step 1, construction of combined vocabulary; Step 1.1, word combination collection: manually collect common word combinations in different fields, which include geographical names, professional terms, organization names, etc. Step 1.2, semantic structure analysis and information setting: for each collected combination word, analyze its semantic structure in depth, and determine the reasonable limited line break position based on the semantic structure. At the same time, set the limited line break position information of the combination word, and record the maximum length of the combination word, recorded as Lmax, and the starting index value of the combination word library index=0, as shown in the schematic diagram Figure 2 This step provides basic data support for subsequent text line splitting, ensuring that the line splitting position conforms to the semantic logic of the compound word.

[0017] Step 2, obtaining the text to be judged; When the text to be processed reaches the end of a line and needs to be split, take Lmax-1 characters from the end of the line, record it as S1, take Lmax-1 characters from the end of the line, record it as S2, combine S1+S2 to get the text to be judged S, and at the same time, record the position of the end of the line in the text to be judged S, record it as P0 (P0=Lmax-1), as shown in the schematic diagram Figure 3 ,In this way, a text segment with the end of line position information and ,appropriate length is obtained so as to match and judge the line splitting position in the ,combined vocabulary.

[0018] Step 3: determine the row splitting position and execute the row splitting process; Step 3.1, initialization: Initialize the matching start position Ps of the character sequence of the text to be judged to 0.

[0019] Step 3.2, combination word matching: determine whether the combination word index value index is equal to the length of the combination word library. If the combination word index value index is equal to the length of the combination word library, that is, the combination word library query is completed, then go to step 3.5; if the combination word index value index is less than the length of the combination word library, then take a word from index, record the taken word as the string to be matched W, the length of the string to be matched W is recorded as Lw, and the combination word index value index increases by 1, that is, index=index+1.

[0020] Step 3.3, Judgment of line break position: Starting from the matching start position Ps of the character sequence of the text S to be judged, compare the character sequence in the text S to be judged with the character sequence of the string W to be matched one by one in the character order. If after traversing the entire text S to be judged, no character sequence that is exactly the same and continuous as the string W to be matched is found, it is determined that the match fails, and step 3.1 is repeated; when there is a character sequence in the text S to be judged that is exactly the same and continuous as the string W to be matched, it is determined that the match is successful, and record the position of the string W to be matched in the text S to be judged as P1. If P1 >= P0, that is, the entire word of the string W to be matched is after the end position of the line, then step 3.1 is repeated. If P1 + Lw <= P0, that is, the entire word of the string W to be matched is before the end position of the line, then Ps is set to P1 + Lw, and step 3.3 is repeated. At this time, the end position of the line falls in the middle of the character sequence of the string W to be matched, that is, P1 < P0 and P1 + Lw > P0 are satisfied. The schematic diagram is shown in Figure 4 , this step provides a basis for determining the line break position by matching the position of the combined word in the text to be judged and judging the position of the end position of the line in the character sequence of the combined word.

[0021] Step 3.4, Perform line break processing: Move forward from the position P0 - P1 in the string W to be matched, and search for the defined line break position Pw in the string W to be matched; if the defined line break position Pw is found, then perform a line break at P1 + Pw; if the defined line break position Pw is not found, then perform a line break at P1, and go to step 3.6; the schematic diagram is shown in Figure 5 ; This step accurately judges and determines the final line break position based on the position of the combined word in the text to be judged, the position of the end position of the line in the character sequence of the combined word, and the information of the defined line break position of the combined word itself.

[0022] Step 3.5, Default line break: If no suitable line break basis is found after querying the combined word library, then perform a line break at P0. This is the default line break method when there is no other better line break option.

[0023] Step 3.6, Line break completed: After completing the above line break operation, the line break processing is completed. The schematic diagram is shown in Figure 6 .

[0024] The description of the present invention is given for purposes of illustration and description, and is not intended to be exhaustive or to limit the invention to the disclosed form. Many modifications and variations are obvious to those of ordinary skill in the art. The embodiments are chosen and described in order to best explain the principles of the invention and its practical application, and to enable those of ordinary skill in the art to understand the invention and design various embodiments with various modifications suitable for specific purposes.

Claims

1. A method for processing line splitting at a limited position of a combination word, characterized by: The following steps are involved: Step 1, construction of combined vocabulary; Step 2, obtaining the text to be judged; Step 3, judging the line break position and performing line break processing; The step 1 comprises the following steps: Step 1.1, collection of compound words; Step 1.2, semantic structure analysis and information setting; The step 3 comprises the following steps: Step 3.1, initialization: Initialize the matching start position Ps of the character sequence of the text to be judged to 0; Step 3.2, combination word matching; Step 3.3, determine the row splitting position; Step 3.4, perform row splitting processing; Step 3.5, default line splitting; Step 3.6, row splitting is completed.

2. A method for breaking a word into smaller parts according to claim 1, characterized in that: The step 1.2 comprises the following steps: For each collected combination word, we deeply analyze its semantic structure and determine the reasonable limit line breaking position according to the semantic structure; At the same time, set the limited line breaking position information of the combination word, and record the maximum length of the combination word, denoted as Lmax, and the starting index value of the combination word library index=0. This step provides basic data support for subsequent text line breaking to ensure that the line breaking position conforms to the semantic logic of the combination word.

3. A method for processing line breaking at a limited position of a combination word as claimed in claim 2, characterized in that: The step 2 comprises the following steps: When the text to be processed needs to be split at the end of a line, take Lmax-1 characters from the end of the line, recorded as S1, and take Lmax-1 characters from the end of the line, recorded as S2. Combine S1+S2 to get the text S to be judged. At the same time, record the position of the end of the line in S, recorded as P0, P0=Lmax-1. In this way, a text fragment with appropriate length containing the end of the line position information is obtained, so as to match and judge the line split position in the combined vocabulary.

4. A method for breaking a word into smaller parts according to claim 3, characterized in that: The step 3.2 comprises the following steps: Combined word matching: Determine whether the combined word index value index is equal to the length of the combined word library. If the combined word index value index is equal to the length of the combined word library, that is, the combined word library query is completed, then go to step 3.5; if the combined word index value index is less than the length of the combined word library, then take a word from index, record the taken word as the string to be matched W, and the length of the string to be matched W is recorded as Lw. The combined word index value index increases by 1, that is, index=index+1.

5. A method for processing line breaking at a limited position of a combination word as claimed in claim 4, characterized in that: The step 3.3 comprises the following steps: Starting from the matching start position Ps of the character sequence of the text S to be judged, compare the character sequence in the text S to be judged with the character sequence of the string W to be matched one by one in character order. If, after traversing the entire text S to be judged, no character sequence that is exactly the same and continuous as the string W to be matched is found, it is determined that the match fails, and step 3.1 is repeated; when there is a character sequence in the text S to be judged that is exactly the same and continuous as the string W to be matched, it is determined that the match is successful, and record the position of the string W to be matched in the text S to be judged as P1. If P1≥P0, that is, the entire word of the string W to be matched is after the end position of the line, then step 3.1 is repeated. If P1+Lw≤P0, that is, the entire word of the string W to be matched is before the end position of the line, then Ps is set to P1+Lw, and step 3.3 is repeated. At this time, the end position of the line falls in the middle of the character sequence of the string W to be matched, that is, P1<P0 and P1+Lw>P0 are satisfied. This step provides a basis for determining the line break position by matching the position of the combined word in the text to be judged and judging the position of the end position of the line in the character sequence of the combined word.

6. A method for breaking a word at a limited position according to claim 5, characterized in that: Step 3.4 includes the following steps: Search forward from the position P0-P1 in the string W to be matched to find the defined line break position Pw in the string W to be matched; if the defined line break position Pw is found, then break the line at P1+Pw; if the defined line break position Pw is not found, then break the line at P1, and go to step 3.6; this step accurately judges and determines the final line break position based on the position of the combined word in the text to be judged, the position of the end position of the line in the character sequence of the combined word, and the information of the defined line break position of the combined word itself.

7. A method for processing line breaking at a limited position of a combination word as claimed in claim 6, characterized in that: Step 3.5 includes the following steps: Default line break: If no suitable line break basis is found after querying the combined word library, then break the line at P0. This is the default line break method when there is no other better line break option.

Citation Information

Patent Citations

  • Method and device for line non-breaking processing based of special words

    CN104572750A

  • Long text enterprise name recognition algorithm based on pre-built word bank

    CN110413764A

  • Uyghur text line end syllable splitting processing method on mobile equipment

    CN113536747A

  • Medical record text typesetting method and system, storage medium and electronic equipment

    CN117371446A

  • Method for processing tail syllable splitting of Yiberg Wen

    CN119378489A