Bidirectional Text Segmentation Using LRM and RLM Markers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current Unicode Bidirectional Algorithm (UBA) implementations fail to maintain the structure of structured bidirectional text with an unknown base direction, leading to incorrect display and functioning, as they treat all text as plain and do not account for internal structure.
Innovation Solution
The method involves inserting Unicode left-to-right (LRM) and right-to-left (RLM) characters on either side of a delimited segment of bidirectional text to create a directionality mismatch, which is then processed through a UBA implementation to select the base text direction, ensuring correct ordering and structure preservation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If UBA implementation treats text as plain text, then processing is simple, but structured text structure is not maintained
Solution Approach 1:
The patent applies preliminary action by inserting LRM and RLM characters into the structured text segment before processing through the UBA implementation. This preprocessing step prepares the text with directional markers that guide the algorithm to correctly maintain the structure of structured text (such as URIs, email addresses, and formulas) while still using the standard UBA processing mechanism.
2Measurement precision
If LRM and RLM characters are inserted to create directionality mismatch, then base text direction can be selected correctly, but text processing complexity increases
Solution Approach 1:
The patent uses LRM and RLM characters as intermediary elements that mediate between the unknown base direction of structured text and the UBA algorithm's direction detection mechanism. These control characters act as signals that trigger the algorithm to resolve the directionality conflict and select the correct base text direction, thereby improving detection accuracy without requiring complex custom processing logic.
3Reliability
If Unicode control characters are inserted in delimited segments, then text direction is resolved, but risk of introducing errors increases
Solution Approach 1:
The patent applies local quality by inserting LRM and RLM characters only within delimited structured text segments where directionality ambiguity exists, rather than throughout the entire text. This localized approach ensures that direction resolution is applied precisely where needed (in structured text like URIs and formulas) without unnecessarily modifying other text portions, thereby reducing the overall risk of introducing errors while maintaining reliability in critical segments.
Data Source
AI summary
Embodiments of the present invention include a method, system, and computer program product for isolating a segment of bidirectional text. A segment of bidirectional text may be identified. A Unicode left-to-right character (LRM) may be inserted on at least a first side of the segment of bidirectional text. A Unicode right-to-left character (RLM) may be inserted on at least a second side of the segment of bidirectional text. The segment of bidirectional text may be processed through a Unicode Bidirectional Algorithm (UBA) implementation. A directionality mismatch between the LRM and the RLM may cause a conflict. In response to the conflict, the Unicode Bidirectional Algorithm may select a base text direction for the segment of bidirectional text.


