Class MultiCharacterCaseFolding
java.lang.Object
com.oracle.truffle.regex.tregex.parser.MultiCharacterCaseFolding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcaseClosure(CaseFoldData.CaseFoldAlgorithm algorithm, CodePointSetAccumulator charClass, CodePointSetAccumulator tmp, BiPredicate<Integer, Integer> filter, CodePointSet allowedCodePoints, boolean transitiveEquivalence) This method modifiescharClassto contains its closure on case mapping.caseClosureMultiCodePoint(CaseFoldData.CaseFoldAlgorithm algorithm, CodePointSetAccumulator charClass) Finds any characters incharClassthat have multi-codepoint expansions.static int[]caseFold(CaseFoldData.CaseFoldAlgorithm algorithm, int codePoint) static OracleDBCharClassTrieNodecaseFoldUnfoldString(CaseFoldData.CaseFoldAlgorithm algorithm, int[] codepoints, CodePointSet encodingRange, boolean dropAsciiOnStart, boolean transitiveEquivalence, RegexASTBuilder astBuilder, OracleDBCharClassTrieNode root, CompilationBuffer compilationBuffer) Appends to theastBuildera matcher that matches all case variants of the input string.static booleanequalsIgnoreCase(CaseFoldData.CaseFoldAlgorithm algorithm, int codePointA, int codePointB)
-
Constructor Details
-
MultiCharacterCaseFolding
public MultiCharacterCaseFolding()
-
-
Method Details
-
caseFoldUnfoldString
public static OracleDBCharClassTrieNode caseFoldUnfoldString(CaseFoldData.CaseFoldAlgorithm algorithm, int[] codepoints, CodePointSet encodingRange, boolean dropAsciiOnStart, boolean transitiveEquivalence, RegexASTBuilder astBuilder, OracleDBCharClassTrieNode root, CompilationBuffer compilationBuffer) Appends to theastBuildera matcher that matches all case variants of the input string.- Parameters:
codepoints- the input string as an array of Unicode codepointsencodingRange- the range of characters that we should limit ourselves todropAsciiOnStart- whether we should forbid ASCII characters on the first positions of the variantstransitiveEquivalence- whether to unconditionally include the case-folded version of every character in the generated expression. If this is set tofalse, case-folded characters that themselves fold to another character are not included in the expression. Example: suppose a characterxcase-folds toy, butyfolds toz. IftransitiveEquivalenceis set tofalse, the generated expression will not includey.astBuilder- where to append the matcherroot- add all matching strings to the given prefix tree
-
caseFold
-
caseClosure
public static void caseClosure(CaseFoldData.CaseFoldAlgorithm algorithm, CodePointSetAccumulator charClass, CodePointSetAccumulator tmp, BiPredicate<Integer, Integer> filter, CodePointSet allowedCodePoints, boolean transitiveEquivalence) This method modifiescharClassto contains its closure on case mapping. -
caseClosureMultiCodePoint
public static List<org.graalvm.collections.Pair<Integer,int[]>> caseClosureMultiCodePoint(CaseFoldData.CaseFoldAlgorithm algorithm, CodePointSetAccumulator charClass) Finds any characters incharClassthat have multi-codepoint expansions.- Returns:
- a list of pairs, with the first element being the expanded codepoint and the second element the expansion
-
equalsIgnoreCase
public static boolean equalsIgnoreCase(CaseFoldData.CaseFoldAlgorithm algorithm, int codePointA, int codePointB)
-