Home
last modified time | relevance | path

Searched refs:rules (Results 1 – 25 of 3499) sorted by relevance

12345678910>>...140

/external/libtextclassifier/native/utils/grammar/utils/
Drules_test.cc33 Rules rules(locale_shard_map); in TEST() local
35 rules.Add("<verb>", {"buy"}); in TEST()
36 rules.Add("<verb>", {"bring"}); in TEST()
37 rules.Add("<verb>", {"remind"}); in TEST()
38 rules.Add("<reminder>", {"remind", "me", "to", "<verb>"}); in TEST()
39 rules.Add("<action>", {"<reminder>"}); in TEST()
41 const Ir ir = rules.Finalize(); in TEST()
45 EXPECT_THAT(frozen_rules.rules, SizeIs(1)); in TEST()
49 EXPECT_THAT(frozen_rules.rules.front()->binary_rules, SizeIs(3)); in TEST()
50 EXPECT_THAT(frozen_rules.rules.front()->unary_rules, SizeIs(1)); in TEST()
[all …]
Dir_test.cc141 RulesSetT rules; in TEST() local
142 ir.Serialize(/*include_debug_information=*/false, &rules); in TEST()
144 EXPECT_THAT(rules.rules, SizeIs(1)); in TEST()
147 EXPECT_THAT(rules.lhs, SizeIs(1)); in TEST()
148 EXPECT_THAT(rules.lhs.front().callback_id(), kOutput); in TEST()
151 EXPECT_THAT(rules.rules.front()->lowercase_terminal_rules->terminal_offsets, in TEST()
153 EXPECT_THAT(rules.rules.front()->terminal_rules->terminal_offsets, IsEmpty()); in TEST()
157 EXPECT_THAT(rules.terminals, in TEST()
160 EXPECT_THAT(rules.rules.front()->binary_rules, SizeIs(3)); in TEST()
163 EXPECT_THAT(rules.rules.front()->unary_rules, SizeIs(1)); in TEST()
[all …]
/external/libtextclassifier/native/annotator/grammar/
Dgrammar-annotator_test.cc48 grammar_model.rules.reset(new grammar::RulesSetT); in TEST_F()
51 grammar::Rules rules(locale_shard_map); in TEST_F() local
52 rules.Add("<carrier>", {"lx"}); in TEST_F()
53 rules.Add("<carrier>", {"aa"}); in TEST_F()
54 rules.Add("<flight_code>", {"<2_digits>"}); in TEST_F()
55 rules.Add("<flight_code>", {"<3_digits>"}); in TEST_F()
56 rules.Add("<flight_code>", {"<4_digits>"}); in TEST_F()
57 rules.Add( in TEST_F()
63 rules.Finalize().Serialize(/*include_debug_information=*/false, in TEST_F()
64 grammar_model.rules.get()); in TEST_F()
[all …]
/external/libtextclassifier/native/utils/grammar/parsing/
Dparser_test.cc46 Rules rules(locale_shard_map); in TEST_F() local
47 rules.Add("<day>", {"<2_digits>"}); in TEST_F()
48 rules.Add("<month>", {"<2_digits>"}); in TEST_F()
49 rules.Add("<year>", {"<4_digits>"}); in TEST_F()
51 rules.Add("<date>", {"<year>", "/", "<month>", "/", "<day>"}, in TEST_F()
53 const std::string rules_buffer = rules.Finalize().SerializeAsFlatbuffer(); in TEST_F()
65 Rules rules(locale_shard_map); in TEST_F() local
67 rules.Add("<test>", {"test"}, in TEST_F()
69 const std::string rules_buffer = rules.Finalize().SerializeAsFlatbuffer(); in TEST_F()
89 Rules rules(locale_shard_map); in TEST_F() local
[all …]
Dmatcher_test.cc128 Rules rules(locale_shard_map); in TEST_F() local
129 rules.Add("<test>", {"the", "quick", "brown", "fox"}, in TEST_F()
131 rules.Add("<action>", {"<test>"}, in TEST_F()
133 const std::string rules_buffer = rules.Finalize().SerializeAsFlatbuffer( in TEST_F()
153 Rules rules(locale_shard_map); in CreateTestGrammar() local
156 rules.Add("<output_5>", {"quick"}, in CreateTestGrammar()
158 rules.Add("<output_0>", {"the"}, in CreateTestGrammar()
162 rules.Add("<output_1>", {"the", "quick", "brown", "fox"}, in CreateTestGrammar()
164 rules.Add("<output_2>", {"the", "quick"}, in CreateTestGrammar()
166 rules.Add("<output_3>", {"brown", "fox"}, in CreateTestGrammar()
[all …]
Dmatcher.h57 explicit Matcher(const UniLib* unilib, const RulesSet* rules, in Matcher() argument
63 rules_(rules), in Matcher()
67 TC3_CHECK_NE(rules, nullptr); in Matcher()
70 explicit Matcher(const UniLib* unilib, const RulesSet* rules, in Matcher() argument
72 : Matcher(unilib, rules, {}, arena) { in Matcher()
73 rules_shards_.reserve(rules->rules()->size());
74 rules_shards_.insert(rules_shards_.end(), rules->rules()->begin(),
75 rules->rules()->end());
/external/libcups/scheduler/
Dtype.c47 mime_magic_t *rules);
179 for (current = mt->rules; current; current = current->next) in mimeAddTypeRule()
286 mt->rules = current = temp; in mimeAddTypeRule()
471 mt->rules = temp; in mimeAddTypeRule()
663 if (mime_check_rules(base, &fb, type->rules)) in mimeFileType()
752 mime_magic_t *rules) /* I - Rules to check */ in mime_check_rules() argument
764 fb, rules)); in mime_check_rules()
766 if (rules == NULL) in mime_check_rules()
769 if (rules->parent == NULL) in mime_check_rules()
772 logic = rules->parent->op; in mime_check_rules()
[all …]
Dtestmime.c28 static void print_rules(mime_magic_t *rules);
172 print_rules(src->rules); in main()
342 print_rules(mime_magic_t *rules) /* I - Rules to print */ in print_rules() argument
348 if (rules == NULL) in print_rules()
351 while (rules != NULL) in print_rules()
353 printf("%s[%p] ", indent, rules); in print_rules()
355 if (rules->invert) in print_rules()
358 switch (rules->op) in print_rules()
361 printf("match(%s)", rules->value.matchv); in print_rules()
364 printf("locale(%s)", rules->value.localev); in print_rules()
[all …]
/external/libtextclassifier/native/actions/
Dgrammar-actions_test.cc146 grammar::Rules rules(locale_shard_map); in TEST_F() local
152 action_grammar_rules.rules.reset(new grammar::RulesSetT); in TEST_F()
153 rules.Add( in TEST_F()
161 rules.Finalize().Serialize(/*include_debug_information=*/false, in TEST_F()
162 action_grammar_rules.rules.get()); in TEST_F()
180 action_grammar_rules.rules.reset(new grammar::RulesSetT); in TEST_F()
182 grammar::Rules rules(locale_shard_map); in TEST_F() local
184 rules.Add( in TEST_F()
195 rules.Add("<command>", {"unsubscribe"}); in TEST_F()
196 rules.Add("<command>", {"cancel"}); in TEST_F()
[all …]
Dzlib-utils_test.cc38 model.rules.reset(new RulesModelT); in TEST()
39 model.rules->regex_rule.emplace_back(new RulesModel_::RegexRuleT); in TEST()
40 model.rules->regex_rule.back()->pattern = kTestPattern1; in TEST()
41 model.rules->regex_rule.emplace_back(new RulesModel_::RegexRuleT); in TEST()
42 model.rules->regex_rule.back()->pattern = kTestPattern2; in TEST()
43 model.rules->regex_rule.back()->output_pattern = kTestOutputPattern; in TEST()
52 EXPECT_THAT(model.rules->regex_rule, in TEST()
66 compressed_model->rules()->regex_rule()->Get(0)->compressed_pattern(), in TEST()
70 compressed_model->rules()->regex_rule()->Get(1)->compressed_pattern(), in TEST()
74 EXPECT_EQ(model.rules->regex_rule[0]->pattern, kTestPattern1); in TEST()
[all …]
/external/iproute2/tc/
Dem_canid.c41 struct rules { struct
58 static int canid_parse_rule(struct rules *rules, struct bstr *a, int iseff) in canid_parse_rule() argument
72 if (rules->rules_cnt == rules->rules_capacity) { in canid_parse_rule()
73 if (rules->rules_capacity <= EM_CANID_RULES_MAX/2) { in canid_parse_rule()
74 rules->rules_capacity *= 2; in canid_parse_rule()
75 rules->rules_raw = realloc(rules->rules_raw, in canid_parse_rule()
76 sizeof(struct can_filter) * rules->rules_capacity); in canid_parse_rule()
82 rules->rules_raw[rules->rules_cnt].can_id = in canid_parse_rule()
84 rules->rules_raw[rules->rules_cnt].can_mask = in canid_parse_rule()
87 rules->rules_cnt++; in canid_parse_rule()
[all …]
/external/libtextclassifier/native/utils/grammar/
Drules-utils.cc21 std::vector<std::vector<Locale>> ParseRulesLocales(const RulesSet* rules) { in ParseRulesLocales() argument
22 if (rules == nullptr || rules->rules() == nullptr) { in ParseRulesLocales()
25 std::vector<std::vector<Locale>> locales(rules->rules()->size()); in ParseRulesLocales()
26 for (int i = 0; i < rules->rules()->size(); i++) { in ParseRulesLocales()
27 const grammar::RulesSet_::Rules* rules_shard = rules->rules()->Get(i); in ParseRulesLocales()
39 const RulesSet* rules, in SelectLocaleMatchingShards() argument
43 if (rules->rules() == nullptr) { in SelectLocaleMatchingShards()
51 shards.push_back(rules->rules()->Get(i)); in SelectLocaleMatchingShards()
/external/icu/icu4j/main/classes/collate/src/com/ibm/icu/impl/coll/
DCollationRuleParser.java131 rules = ruleString; in parse()
134 while(ruleIndex < rules.length()) { in parse()
135 char c = rules.charAt(ruleIndex); in parse()
172 if(ruleIndex < rules.length() && rules.charAt(ruleIndex) == 0x23) { in parseRuleChain()
212 if(rules.regionMatches(i, BEFORE, 0, BEFORE.length()) && in parseResetAndPosition()
213 (j = i + BEFORE.length()) < rules.length() && in parseResetAndPosition()
214 PatternProps.isWhiteSpace(rules.charAt(j)) && in parseResetAndPosition()
215 ((j = skipWhiteSpace(j + 1)) + 1) < rules.length() && in parseResetAndPosition()
216 0x31 <= (c = rules.charAt(j)) && c <= 0x33 && in parseResetAndPosition()
217 rules.charAt(j + 1) == 0x5d) { in parseResetAndPosition()
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/
DCollationRuleParser.java135 rules = ruleString; in parse()
138 while(ruleIndex < rules.length()) { in parse()
139 char c = rules.charAt(ruleIndex); in parse()
176 if(ruleIndex < rules.length() && rules.charAt(ruleIndex) == 0x23) { in parseRuleChain()
216 if(rules.regionMatches(i, BEFORE, 0, BEFORE.length()) && in parseResetAndPosition()
217 (j = i + BEFORE.length()) < rules.length() && in parseResetAndPosition()
218 PatternProps.isWhiteSpace(rules.charAt(j)) && in parseResetAndPosition()
219 ((j = skipWhiteSpace(j + 1)) + 1) < rules.length() && in parseResetAndPosition()
220 0x31 <= (c = rules.charAt(j)) && c <= 0x33 && in parseResetAndPosition()
221 rules.charAt(j + 1) == 0x5d) { in parseResetAndPosition()
[all …]
/external/python/cpython3/Lib/test/test_peg_generator/
Dtest_pegen.py36 rules = grammar.rules
39 self.assertEqual(str(rules["start"]), "start: sum NEWLINE")
40 self.assertEqual(str(rules["sum"]), "sum: term '+' term | term")
42 self.assertEqual(repr(rules["term"]), expected_repr)
60 self.assertEqual(str(grammar.rules["start"]), textwrap.dedent(expected).strip())
68 rules = parse_string(grammar, GrammarParser).rules
70 self.assertEqual(str(rules["start"]), "start: sum NEWLINE")
71 self.assertEqual(str(rules["sum"]), "sum: term '+' term | term")
73 repr(rules["term"]),
82 rules = parse_string(grammar, GrammarParser).rules
[all …]
/external/icu/icu4c/source/i18n/
Dcollationruleparser.cpp61 rules(NULL), baseData(base), settings(NULL), in CollationRuleParser()
91 rules = &ruleString; in parse()
94 while(ruleIndex < rules->length()) { in parse()
95 UChar c = rules->charAt(ruleIndex); in parse()
136 if(ruleIndex < rules->length() && rules->charAt(ruleIndex) == 0x23) { in parseRuleChain()
179 if(rules->compare(i, BEFORE_LENGTH, BEFORE, 0, BEFORE_LENGTH) == 0 && in parseResetAndPosition()
180 (j = i + BEFORE_LENGTH) < rules->length() && in parseResetAndPosition()
181 PatternProps::isWhiteSpace(rules->charAt(j)) && in parseResetAndPosition()
182 ((j = skipWhiteSpace(j + 1)) + 1) < rules->length() && in parseResetAndPosition()
183 0x31 <= (c = rules->charAt(j)) && c <= 0x33 && in parseResetAndPosition()
[all …]
Dnumber_longnames.h35 forCurrencyLongNames(const Locale &loc, const CurrencyUnit &currency, const PluralRules *rules,
60 const UNumberUnitWidth &width, const PluralRules *rules,
81 const PluralRules *rules; variable
85 LongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent) in LongNameHandler() argument
86 : rules(rules), parent(parent) { in LongNameHandler()
89 LongNameHandler() : rules(nullptr), parent(nullptr) { in LongNameHandler()
103 const UNumberUnitWidth &width, const PluralRules *rules,
139 const UNumberUnitWidth &width, const PluralRules *rules,
158 const PluralRules *rules;
176 MixedUnitLongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent) in MixedUnitLongNameHandler() argument
[all …]
/external/python/cpython3/Tools/peg_generator/pegen/
Dparser_generator.py21 def __init__(self, rules: Dict[str, Rule], tokens: Dict[int, str]):
22 self.rules = rules
26 if node.value not in self.rules and node.value not in self.tokens.values():
43 self.rules = grammar.rules
45 if "trailer" not in grammar.metas and "start" not in self.rules:
47 checker = RuleCheckingVisitor(self.rules, self.tokens)
48 for rule in self.rules.values():
52 compute_nullables(self.rules)
53 self.first_graph, self.first_sccs = compute_left_recursives(self.rules)
54 self.todo = self.rules.copy() # Rules to generate
[all …]
/external/rust/crates/pin-project-lite/tests/ui/
Dunsupported.stderr1 error: no rules expected the token `[`
5 4 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
7 | |_^ no rules expected this token in macro call
11 error: no rules expected the token `[`
15 8 | | struct Struct2(); //~ ERROR no rules expected the token `(`
17 | |_^ no rules expected this token in macro call
21 error: no rules expected the token `[`
25 12 | | struct Struct3; //~ ERROR no rules expected the token `;`
27 | |_^ no rules expected this token in macro call
31 error: no rules expected the token `[`
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/text/
DNFRuleSet.java41 private NFRule[] rules; field in NFRuleSet
228 rules = new NFRule[tempRules.size()]; in parseRules()
229 tempRules.toArray(rules); in parseRules()
317 || rules.length != that2.rules.length in equals()
331 for (int i = 0; i < rules.length; i++) { in equals()
332 if (!rules[i].equals(that2.rules[i])) { in equals()
363 for (NFRule rule : rules) { in toString()
570 int hi = rules.length; in findNormalRule()
574 long ruleBaseValue = rules[mid].getBaseValue(); in findNormalRule()
576 return rules[mid]; in findNormalRule()
[all …]
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/text/
DNFRuleSet.java40 private NFRule[] rules; field in NFRuleSet
227 rules = new NFRule[tempRules.size()]; in parseRules()
228 tempRules.toArray(rules); in parseRules()
316 || rules.length != that2.rules.length in equals()
330 for (int i = 0; i < rules.length; i++) { in equals()
331 if (!rules[i].equals(that2.rules[i])) { in equals()
362 for (NFRule rule : rules) { in toString()
569 int hi = rules.length; in findNormalRule()
573 long ruleBaseValue = rules[mid].getBaseValue(); in findNormalRule()
575 return rules[mid]; in findNormalRule()
[all …]
/external/antlr/gunit/src/main/java/org/antlr/gunit/swingui/model/
DTestSuite.java36 protected List<Rule> rules ; field in TestSuite
44 rules = new ArrayList<Rule>(); in TestSuite()
54 rules.add(currentRule); in addRule()
59 for(Rule r: rules) { in hasRule()
68 return rules.size(); in getRuleCount()
72 rules.clear(); in setRules()
73 rules.addAll(newRules); in setRules()
82 public Rule getRule(int index) { return rules.get(index); } in getRule()
89 for(Rule rule: rules) { in getRule()
98 public List<Rule> getRulesForStringTemplate() {return rules;} in getRulesForStringTemplate()
/external/icu/libicu/cts_headers/
Dnumber_longnames.h35 forCurrencyLongNames(const Locale &loc, const CurrencyUnit &currency, const PluralRules *rules,
60 const UNumberUnitWidth &width, const PluralRules *rules,
81 const PluralRules *rules; variable
85 LongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent) in LongNameHandler() argument
86 : rules(rules), parent(parent) { in LongNameHandler()
89 LongNameHandler() : rules(nullptr), parent(nullptr) { in LongNameHandler()
103 const UNumberUnitWidth &width, const PluralRules *rules,
139 const UNumberUnitWidth &width, const PluralRules *rules,
158 const PluralRules *rules;
176 MixedUnitLongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent) in MixedUnitLongNameHandler() argument
[all …]
/external/deqp/modules/egl/
DteglChooseConfigReference.cpp287 std::map<EGLenum, AttribRule> rules; in getDefaultRules() local
290rules[EGL_BUFFER_SIZE] = AttribRule(EGL_BUFFER_SIZE, 0, CRITERIA_AT_LEAST, SORTORDER_SMA… in getDefaultRules()
291rules[EGL_RED_SIZE] = AttribRule(EGL_RED_SIZE, 0, CRITERIA_AT_LEAST, SORTORDER_SPECIAL… in getDefaultRules()
292rules[EGL_GREEN_SIZE] = AttribRule(EGL_GREEN_SIZE, 0, CRITERIA_AT_LEAST, SORTORDER_SPECI… in getDefaultRules()
293rules[EGL_BLUE_SIZE] = AttribRule(EGL_BLUE_SIZE, 0, CRITERIA_AT_LEAST, SORTORDER_SPECIA… in getDefaultRules()
294rules[EGL_LUMINANCE_SIZE] = AttribRule(EGL_LUMINANCE_SIZE, 0, CRITERIA_AT_LEAST, SORTORDER… in getDefaultRules()
295rules[EGL_ALPHA_SIZE] = AttribRule(EGL_ALPHA_SIZE, 0, CRITERIA_AT_LEAST, SORTORDER_SPECI… in getDefaultRules()
296rules[EGL_ALPHA_MASK_SIZE] = AttribRule(EGL_ALPHA_MASK_SIZE, 0, CRITERIA_AT_LEAST, SORTORD… in getDefaultRules()
297rules[EGL_BIND_TO_TEXTURE_RGB] = AttribRule(EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE, CRITERIA_EX… in getDefaultRules()
298rules[EGL_BIND_TO_TEXTURE_RGBA] = AttribRule(EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE, CRITERIA_… in getDefaultRules()
[all …]
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/
DPluralRulesTest.java95 PluralRules rules = factory.forLocale(locale); in testOverUnderflow() local
97 assertEquals(locale + " NaN", "other", rules.select(Double.NaN)); in testOverUnderflow()
98 assertEquals(locale + " ∞", "other", rules.select(Double.POSITIVE_INFINITY)); in testOverUnderflow()
99 assertEquals(locale + " -∞", "other", rules.select(Double.NEGATIVE_INFINITY)); in testOverUnderflow()
162 String rules = (String) shouldFailTest[0]; in testSyntaxRestrictions() local
166 PluralRules.parseDescription(rules); in testSyntaxRestrictions()
170 assertEquals("Exception " + rules, exception, actualException); in testSyntaxRestrictions()
222 …public void checkOldSamples(String description, PluralRules rules, String keyword, SampleType samp…
224 Collection<Double> oldSamples = rules.getSamples(keyword, sampleType);
227 rules.getSamples(keyword, sampleType);
[all …]

12345678910>>...140