Home
last modified time | relevance | path

Searched refs:codepoint_span (Results 1 – 20 of 20) sorted by relevance

/aosp_15_r20/external/libtextclassifier/native/utils/grammar/parsing/
H A Dmatcher.cc259 void Matcher::AddTerminal(const CodepointSpan codepoint_span, in AddTerminal() argument
261 TC3_CHECK_GE(codepoint_span.second, last_end_); in AddTerminal()
264 if (codepoint_span.second > last_end_) { in AddTerminal()
268 last_end_ = codepoint_span.second; in AddTerminal()
277 codepoint_span, match_offset, in AddTerminal()
278 /*whitespace_gap=*/(codepoint_span.first - match_offset), in AddTerminal()
293 codepoint_span, match_offset, in AddTerminal()
294 /*whitespace_gap=*/(codepoint_span.first - match_offset), in AddTerminal()
306 TC3_CHECK_GE(parse_tree->codepoint_span.second, last_end_); in AddParseTree()
309 if (parse_tree->codepoint_span.second > last_end_) { in AddParseTree()
[all …]
H A Dderivation.h58 if (a.GetParseTree()->codepoint_span.first != in DeduplicateDerivations()
59 b.GetParseTree()->codepoint_span.first) { in DeduplicateDerivations()
60 return a.GetParseTree()->codepoint_span.first < in DeduplicateDerivations()
61 b.GetParseTree()->codepoint_span.first; in DeduplicateDerivations()
65 return a.GetParseTree()->codepoint_span.second > in DeduplicateDerivations()
66 b.GetParseTree()->codepoint_span.second; in DeduplicateDerivations()
81 if (sorted_candidates[j].parse_tree->codepoint_span.first <= in DeduplicateDerivations()
82 candidate.parse_tree->codepoint_span.first && in DeduplicateDerivations()
83 sorted_candidates[j].parse_tree->codepoint_span.second >= in DeduplicateDerivations()
84 candidate.parse_tree->codepoint_span.second) { in DeduplicateDerivations()
H A Dlexer.h70 Symbol(const Type type, const CodepointSpan codepoint_span, in Symbol()
73 codepoint_span(codepoint_span), in Symbol()
80 codepoint_span(parse_tree->codepoint_span), in Symbol()
88 CodepointSpan codepoint_span; member
108 const CodepointSpan codepoint_span,
H A Dparser.cc186 return std::tie(a.codepoint_span.second, a.codepoint_span.first) < in SortedSymbolsForInput()
187 std::tie(b.codepoint_span.second, b.codepoint_span.first); in SortedSymbolsForInput()
208 nonterminals_->digits_nt(), symbol.codepoint_span, in EmitSymbol()
215 symbol.codepoint_span.second - symbol.codepoint_span.first; in EmitSymbol()
222 symbol.codepoint_span, symbol.match_offset, in EmitSymbol()
235 nonterminals_->uppercase_token_nt(), symbol.codepoint_span, in EmitSymbol()
245 matcher->AddTerminal(symbol.codepoint_span, symbol.match_offset, in EmitSymbol()
250 nonterminals_->token_nt(), symbol.codepoint_span, symbol.match_offset, in EmitSymbol()
H A Dchart.h44 (value_->codepoint_span.second < match_offset_); in Done()
62 item->next = chart_[item->codepoint_span.second & kChartHashTableBitmask]; in Add()
63 chart_[item->codepoint_span.second & kChartHashTableBitmask] = item; in Add()
76 while (value != nullptr && (value->codepoint_span.second > match_offset)) { in MatchesEndingAt()
99 it.Item()->codepoint_span.first == span.first) { in HasMatch()
H A Dparse-tree.h53 explicit ParseTree(const Nonterm lhs, const CodepointSpan& codepoint_span, in ParseTree()
57 codepoint_span(codepoint_span), in ParseTree()
71 return codepoint_span.first != match_offset; in HasLeadingWhitespace()
86 CodepointSpan codepoint_span; member
H A Dmatcher_test.cc40 CodepointSpan codepoint_span; member
48 << ", begin=" << match.codepoint_span.first in operator <<()
49 << ", end=" << match.codepoint_span.second in operator <<()
60 return ExplainMatchResult(CodepointSpan(begin, end), arg.codepoint_span,
70 return ExplainMatchResult(CodepointSpan(begin, end), arg.codepoint_span,
110 result.back().codepoint_span = derivation.parse_tree->codepoint_span; in GetMatchResults()
H A Dlexer_test.cc37 << symbol.codepoint_span.first << ", " in operator <<()
38 << symbol.codepoint_span.second in operator <<()
82 ExplainMatchResult(CodepointSpan(begin, end), arg.codepoint_span,
H A Dlexer.cc32 const CodepointSpan codepoint_span, in AppendTokenSymbols() argument
41 CodepointIndex sub_token_start = codepoint_span.first; in AppendTokenSymbols()
H A Dmatcher.h87 void AddTerminal(const CodepointSpan codepoint_span, const int match_offset,
101 void ExecuteLhsSet(const CodepointSpan codepoint_span, const int match_offset,
/aosp_15_r20/external/libtextclassifier/native/annotator/grammar/
H A Dgrammar-annotator.cc49 return parse_tree->codepoint_span; in MatchSelectionBoundaries()
67 span = it->second->codepoint_span; in MatchSelectionBoundaries()
69 span.first = std::min(span.first, it->second->codepoint_span.first); in MatchSelectionBoundaries()
70 span.second = std::max(span.second, it->second->codepoint_span.second); in MatchSelectionBoundaries()
97 if (!SpansOverlap(selection, derivation.parse_tree->codepoint_span)) { in OverlappingDerivations()
181 input_context.Span(capturing_match->codepoint_span); in InstantiateClassificationFromDerivation()
/aosp_15_r20/external/libtextclassifier/native/annotator/
H A Dannotator.cc2067 CodepointSpan codepoint_span = in ModelAnnotate() local
2069 if (!codepoint_span.IsValid() || in ModelAnnotate()
2070 codepoint_span.second > line_codepoints.size()) { in ModelAnnotate()
2073 codepoint_span = selection_feature_processor_->StripBoundaryCodepoints( in ModelAnnotate()
2074 /*span_begin=*/line_codepoints[codepoint_span.first], in ModelAnnotate()
2075 /*span_end=*/line_codepoints[codepoint_span.second], codepoint_span); in ModelAnnotate()
2077 codepoint_span = StripUnpairedBrackets( in ModelAnnotate()
2078 /*span_begin=*/line_codepoints[codepoint_span.first], in ModelAnnotate()
2079 /*span_end=*/line_codepoints[codepoint_span.second], codepoint_span, in ModelAnnotate()
2084 if (codepoint_span.first != codepoint_span.second) { in ModelAnnotate()
[all …]
H A Dfeature-processor.cc333 const CodepointSpan& codepoint_span, in CodepointSpanToTokenSpan() argument
335 const int codepoint_start = codepoint_span.first; in CodepointSpanToTokenSpan()
336 const int codepoint_end = codepoint_span.second; in CodepointSpanToTokenSpan()
382 const CodepointSpan& codepoint_span) { in FindTokenThatContainsSpan() argument
383 const int codepoint_start = codepoint_span.first; in FindTokenThatContainsSpan()
384 const int codepoint_end = codepoint_span.second; in FindTokenThatContainsSpan()
H A Dfeature-processor.h79 const CodepointSpan& codepoint_span,
/aosp_15_r20/external/libtextclassifier/native/utils/grammar/testing/
H A Dutils.h43 << ", begin=" << parse_tree->codepoint_span.first
44 << ", end=" << parse_tree->codepoint_span.second << ")";
60 arg.parse_tree->codepoint_span,
/aosp_15_r20/external/libtextclassifier/native/actions/
H A Dgrammar-actions.cc80 text_context.Span(capturing_match->codepoint_span); in InstantiateActionsFromMatch()
100 /*span=*/capturing_match->codepoint_span, group, in InstantiateActionsFromMatch()
/aosp_15_r20/external/libtextclassifier/native/utils/grammar/semantics/evaluators/
H A Dspan-eval.h39 context.text_context->Span(context.parse_tree->codepoint_span), arena); in Apply()
/aosp_15_r20/external/libtextclassifier/native/annotator/datetime/
H A Dgrammar-parser.cc120 evaluated_derivation.parse_tree->codepoint_span; in Parse()
/aosp_15_r20/external/libtextclassifier/native/utils/grammar/semantics/
H A Dcomposer.cc114 text_context.Span(constituent->codepoint_span), arena); in Eval()
/aosp_15_r20/external/libtextclassifier/native/annotator/number/
H A Dnumber_test-include.cc126 const CodepointSpan& codepoint_span, const std::string& collection, in IsAnnotatedSpan() argument
130 IsCorrectSpan(codepoint_span), in IsAnnotatedSpan()