Home
last modified time | relevance | path

Searched refs:Nonterm (Results 1 – 11 of 11) sorted by relevance

/external/libtextclassifier/native/utils/grammar/utils/
Dir.h81 Nonterm nonterminal = kUnassignedNonterm;
94 std::unordered_map<Nonterm, LhsSet> unary_rules;
106 Nonterm AddNonterminal(const std::string& name = "") {
107 const Nonterm nonterminal = ++num_nonterminals_;
116 void SetNonterminal(const std::string& name, const Nonterm nonterminal) { in SetNonterminal()
122 Nonterm DefineNonterminal(Nonterm nonterminal) { in DefineNonterminal()
127 Nonterm AddUnshareableNonterminal(const std::string& name = "") {
128 const Nonterm nonterminal = AddNonterminal(name);
134 Nonterm GetNonterminalForName(const std::string& name) const { in GetNonterminalForName()
143 Nonterm Add(const Lhs& lhs, const std::string& terminal,
[all …]
Dir_test.cc39 const Nonterm t1 = ir.Add(kUnassignedNonterm, "the"); in TEST()
42 const Nonterm t2 = ir.Add(kUnassignedNonterm, "quick"); in TEST()
45 const Nonterm t3 = ir.Add(kUnassignedNonterm, "quick"); in TEST()
49 const Nonterm t4_unshareable = ir.AddUnshareableNonterminal(); in TEST()
54 const Nonterm t5 = ir.Add(kUnassignedNonterm, "brown"); in TEST()
57 const Nonterm t6_unshareable = ir.AddUnshareableNonterminal(); in TEST()
61 const Nonterm t7 = ir.Add(kUnassignedNonterm, "brown"); in TEST()
82 const std::vector<Nonterm> rhs = { in TEST()
88 std::vector<Nonterm> rhs_truncated = rhs; in TEST()
90 const Nonterm nt_u = ir.AddUnshareableNonterminal(); in TEST()
[all …]
Dir.cc139 const std::unordered_map<Nonterm, Ir::LhsSet>& unary_rules, in SerializeUnaryRulesShard() argument
174 Nonterm Ir::AddToSet(const Lhs& lhs, LhsSet* lhs_set) { in AddToSet()
176 Nonterm shareable_nonterm = lhs.nonterminal; in AddToSet()
228 Nonterm Ir::Add(const Lhs& lhs, const std::string& terminal, in Add()
238 Nonterm Ir::Add(const Lhs& lhs, const std::vector<Nonterm>& rhs, in Add()
246 Nonterm prev = rhs.front(); in Add()
253 Nonterm Ir::AddRegex(Nonterm lhs, const std::string& regex_pattern) { in AddRegex()
259 void Ir::AddAnnotation(const Nonterm lhs, const std::string& annotation) { in AddAnnotation()
411 if (const Nonterm n_digits_nt = in Serialize()
Drules.cc45 Nonterm GetAssignedIdForNonterminal( in GetAssignedIdForNonterminal()
46 const int nonterminal, const std::unordered_map<int, Nonterm>& assignment) { in GetAssignedIdForNonterminal()
57 const std::unordered_map<int, Nonterm>& nonterminals) { in IsRhsAssigned()
82 std::unordered_map<int, Nonterm>* nonterminals, Ir* ir) { in LowerRule()
103 std::vector<Nonterm> rhs_nonterms; in LowerRule()
110 Nonterm nonterminal_id = in LowerRule()
430 std::unordered_map<int, Nonterm> nonterminal_ids; in Finalize()
489 const Nonterm filler = rules.GetNonterminalForName(kFiller); in Finalize()
490 const Nonterm token = in Finalize()
493 rules.Add(filler, std::vector<Nonterm>{token, filler}); in Finalize()
/external/libtextclassifier/native/utils/grammar/parsing/
Dparse-tree.h53 explicit ParseTree(const Nonterm lhs, const CodepointSpan& codepoint_span, in ParseTree()
80 Nonterm lhs = kUnassignedNonterm;
105 explicit MappingNode(const Nonterm arg_lhs, in MappingNode()
117 explicit AssertionNode(const Nonterm arg_lhs, in AssertionNode()
130 explicit ExclusionNode(const Nonterm arg_lhs, in ExclusionNode()
133 const Nonterm arg_exclusion_nonterm) in ExclusionNode()
140 Nonterm exclusion_nonterm;
145 explicit AnnotationNode(const Nonterm arg_lhs, in AnnotationNode()
157 explicit SemanticExpressionNode(const Nonterm arg_lhs, in SemanticExpressionNode()
Dchart.h58 bool HasMatch(const Nonterm nonterm, const CodepointSpan& span) const;
93 bool Chart<NumBuckets>::HasMatch(const Nonterm nonterm, in HasMatch()
Dmatcher.cc180 const Nonterm nonterminal) { in FindUnaryRulesMatches()
223 Nonterm* nonterminal, CallbackId* callback, int64* param, in GetLhs()
325 Nonterm prev_lhs = kUnassignedNonterm; in ExecuteLhsSet()
327 Nonterm lhs; in ExecuteLhsSet()
Dparser.h49 Nonterm nonterm;
Dmatcher_test.cc94 const Nonterm nonterminal) const { in GetNonterminalName()
179 Nonterm FindNontermForName(const RulesSet* rules, in FindNontermForName()
Dparser.cc216 const Nonterm n_digits_nt = in EmitSymbol()
/external/libtextclassifier/native/utils/grammar/
Dtypes.h28 typedef uint32 Nonterm; typedef
32 const Nonterm kUnassignedNonterm = 0;
49 using TwoNonterms = std::pair<Nonterm, Nonterm>;