public class BidiAnalyzer extends Object
BidiStrategy specified by the user.| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
BidiAnalyzer.BidiRun |
Stores the division of internal text directions of a section.
|
static class |
BidiAnalyzer.BidiStrategy |
Enumerates the bidirectional text recognition strategies.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static boolean |
getBidiRuns(BidiAnalyzer.BidiStrategy strategy,
CharSequence text,
List<BidiAnalyzer.BidiRun> runs) |
Checks whether the general direction of
text is RTL based on the specified strategy,
and saves the direction division result to the runs list. |
static boolean |
getBidiRuns(BidiAnalyzer.BidiStrategy strategy,
CharSequence text,
List<BidiAnalyzer.BidiRun> runs,
String locale) |
Checks whether the general direction of text is RTL based on the specified
strategy
and locale, and saves the direction division result to the runs list. |
static boolean |
isRtl(BidiAnalyzer.BidiStrategy strategy,
CharSequence text) |
Checks whether the general direction of
text is RTL based on the specified strategy and the
Locale configured in the system. |
static boolean |
isRtl(BidiAnalyzer.BidiStrategy strategy,
CharSequence text,
String locale) |
Checks whether the general direction of
text is RTL based on the specified strategy
and locale. |
public static boolean isRtl(BidiAnalyzer.BidiStrategy strategy, CharSequence text)
text is RTL based on the specified strategy and the
Locale configured in the system.strategy - Indicates the bidirectional text recognition strategy.text - Indicates the text to be recognized.true if the general direction of text is RTL; returns false otherwise.IllegalArgumentException - Throws this exception if a specified parameter is empty.public static boolean isRtl(BidiAnalyzer.BidiStrategy strategy, CharSequence text, String locale)
text is RTL based on the specified strategy
and locale.
Ensure that locale is a valid locale ID.
strategy - Indicates the bidirectional text recognition strategy.text - Indicates the text to be recognized.locale - Indicates the locale ID.true if the general direction of text is RTL; returns false otherwise.IllegalArgumentException - Throws this exception if a specified parameter is empty.public static boolean getBidiRuns(BidiAnalyzer.BidiStrategy strategy, CharSequence text, List<BidiAnalyzer.BidiRun> runs)
text is RTL based on the specified strategy,
and saves the direction division result to the runs list.strategy - Indicates the bidirectional text recognition strategy.text - Indicates the text to be recognized.runs - Indicates a list of the direction division result.true if the general direction of text is RTL; returns false otherwise.IllegalArgumentException - Throws this exception if a specified parameter is empty.public static boolean getBidiRuns(BidiAnalyzer.BidiStrategy strategy, CharSequence text, List<BidiAnalyzer.BidiRun> runs, String locale)
strategy
and locale, and saves the direction division result to the runs list.strategy - Indicates the bidirectional text recognition strategy.text - Indicates the text to be recognized.runs - Indicates a list of the direction division result.locale - Indicates the locale ID.true if the general direction of text is RTL; returns false otherwise.IllegalArgumentException - Throws this exception if a specified parameter is empty.