Home
last modified time | relevance | path

Searched refs:SimpleEdge (Results 1 – 12 of 12) sorted by relevance

/third_party/libphonenumber/metadata/src/main/java/com/google/i18n/phonenumbers/metadata/regex/
DEdge.java45 void visit(SimpleEdge edge); in visit()
61 private static final SimpleEdge EPSILON = new SimpleEdge();
63 private static final SimpleEdge ANY = new SimpleEdge(ALL_DIGITS_MASK, false);
65 private static final SimpleEdge OPTIONAL_ANY = ANY.optional();
68 public static SimpleEdge fromMask(int digitMask) { in fromMask()
69 return digitMask == ALL_DIGITS_MASK ? ANY : new SimpleEdge(digitMask, false); in fromMask()
77 public static SimpleEdge epsilon() { in epsilon()
82 public static SimpleEdge any() { in any()
87 public static SimpleEdge optionalAny() { in optionalAny()
131 public static final class SimpleEdge extends Edge { class in Edge
[all …]
DTrailingPathOptimizer.java29 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
51 public static ValueGraph<Node, SimpleEdge> optimize(ValueGraph<Node, SimpleEdge> graph) { in optimize()
52 MutableValueGraph<Node, SimpleEdge> out = Graphs.copyOf(graph); in optimize()
129 Node node, AnyPath path, MutableValueGraph<Node, SimpleEdge> g, Map<Node, AnyPath> anyPaths) { in recursivelyDetachTrailingPaths()
161 private static boolean beginsAnAnyPath(Node target, ValueGraph<Node, SimpleEdge> g) { in beginsAnAnyPath()
178 private static boolean canTerminate(Node node, ValueGraph<Node, SimpleEdge> g) { in canTerminate()
186 Node node, Node end, AnyPath path, Node lastAdded, MutableValueGraph<Node, SimpleEdge> out) { in addPath()
DRangeTreeConverter.java29 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
51 public static ValueGraph<Node, SimpleEdge> toNfaGraph(RangeTree ranges) { in toNfaGraph()
58 private final MutableValueGraph<Node, SimpleEdge> graph = ValueGraphBuilder
85 SimpleEdge simpleEdge = Edge.fromMask(dfaEdge.getDigitMask()); in visit()
91 SimpleEdge epsilon = graph.putEdgeValue(source, target, simpleEdge); in visit()
DNfaFlattener.java24 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
44 public static Edge flatten(ValueGraph<Node, SimpleEdge> graph) { in flatten()
66 private final ValueGraph<Node, SimpleEdge> graph;
70 private NfaFlattener(ValueGraph<Node, SimpleEdge> graph) { in NfaFlattener()
DEdgeWriter.java25 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
72 public void visit(SimpleEdge e) { in visit()
175 public void visit(SimpleEdge edge) { in visit()
DRegexGenerator.java29 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
165 ValueGraph<Node, SimpleEdge> nfa = RangeTreeConverter.toNfaGraph(ranges); in regexOf()
/third_party/libphonenumber/metadata/src/test/java/com/google/i18n/phonenumbers/metadata/regex/
DRangeTreeConverterTest.java31 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
45 ValueGraph<Node, SimpleEdge> nfa = RangeTreeConverter.toNfaGraph(dfa); in testSimple()
59 ValueGraph<Node, SimpleEdge> nfa = RangeTreeConverter.toNfaGraph(dfa); in testWithOptionalEdge()
73 ValueGraph<Node, SimpleEdge> nfa = RangeTreeConverter.toNfaGraph(dfa); in testWithEpsilon()
92 ValueGraph<Node, SimpleEdge> nfa = RangeTreeConverter.toNfaGraph(dfa); in testMultiplePathsWithCommonTail()
112 ValueGraph<Node, SimpleEdge> nfa = RangeTreeConverter.toNfaGraph(dfa); in testOptionalTopLevelGroup_bug_69101586()
121 SimpleEdge edge(int n) { in edge()
122 return SimpleEdge.fromMask(1 << n); in edge()
130 Node assertOutEdge(ValueGraph<Node, SimpleEdge> nfa, Node node, SimpleEdge edge) { in assertOutEdge()
138 void assertOutEdges(ValueGraph<Node, SimpleEdge> nfa, Node node, SimpleEdge... edges) { in assertOutEdges()
[all …]
DNfaBuilder.java27 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
31 private final MutableValueGraph<Node, SimpleEdge> graph =
47 public ValueGraph<Node, SimpleEdge> graph() { in graph()
56 addEdge(source, lastNode, SimpleEdge.fromMask(spec.getBitmask(n))); in addPath()
67 addEdge(source, lastNode, SimpleEdge.fromMask(spec.getBitmask(n))); in addPath()
70 addEdge(source, target, SimpleEdge.fromMask(spec.getBitmask(spec.length() - 1))); in addPath()
85 SimpleEdge e = graph.putEdgeValue(s, t, Edge.epsilon()); in addEpsilon()
93 private void addEdge(Node s, Node t, SimpleEdge e) { in addEdge()
DTrailingPathOptimizerTest.java24 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
36 ValueGraph<Node, SimpleEdge> actual = TrailingPathOptimizer.optimize(nfa.graph()); in testSimple()
55 ValueGraph<Node, SimpleEdge> actual = TrailingPathOptimizer.optimize(nfa.graph()); in testTrailingOptionalGroup()
77 ValueGraph<Node, SimpleEdge> actual = TrailingPathOptimizer.optimize(nfa.graph()); in testDoubleRecursion()
112 ValueGraph<Node, SimpleEdge> actual = TrailingPathOptimizer.optimize(nfa.graph()); in testNoChangeIfNoCommonFactor()
116 private static void assertEquivalent(ValueGraph<Node, SimpleEdge> actual, NfaBuilder expected) { in assertEquivalent()
DEdgeTest.java26 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
183 public void visit(SimpleEdge edge) { in visit()
202 private static SimpleEdge e(String s) { in e()
205 return SimpleEdge.fromMask(spec.getBitmask(0)); in e()
DEdgeWriterTest.java23 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
123 private static SimpleEdge e(String s) { in e()
126 return SimpleEdge.fromMask(spec.getBitmask(0)); in e()
DNfaFlattenerTest.java25 import com.google.i18n.phonenumbers.metadata.regex.Edge.SimpleEdge;
198 private static SimpleEdge e(String s) { in e()
201 return SimpleEdge.fromMask(spec.getBitmask(0)); in e()