Home
last modified time | relevance | path

Searched refs:DatetimeComponent (Results 1 – 19 of 19) sorted by relevance

/external/libtextclassifier/native/annotator/datetime/
Dregex-parser_test.cc90 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 1) in TEST_F()
91 .Add(DatetimeComponent::ComponentType::MONTH, 1) in TEST_F()
92 .Add(DatetimeComponent::ComponentType::YEAR, 1988) in TEST_F()
100 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 1) in TEST_F()
101 .Add(DatetimeComponent::ComponentType::MONTH, 1) in TEST_F()
102 .Add(DatetimeComponent::ComponentType::YEAR, 1988) in TEST_F()
107 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 31) in TEST_F()
108 .Add(DatetimeComponent::ComponentType::MONTH, 1) in TEST_F()
109 .Add(DatetimeComponent::ComponentType::YEAR, 2018) in TEST_F()
114 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 1) in TEST_F()
[all …]
Dgrammar-parser_test.cc75 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 1) in TEST_F()
76 .Add(DatetimeComponent::ComponentType::MONTH, 2) in TEST_F()
77 .Add(DatetimeComponent::ComponentType::YEAR, 2020) in TEST_F()
86 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 2) in TEST_F()
87 .Add(DatetimeComponent::ComponentType::MONTH, 1) in TEST_F()
88 .Add(DatetimeComponent::ComponentType::YEAR, 2020) in TEST_F()
94 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 1) in TEST_F()
95 .Add(DatetimeComponent::ComponentType::MONTH, 1) in TEST_F()
96 .Add(DatetimeComponent::ComponentType::YEAR, 1988) in TEST_F()
104 .Add(DatetimeComponent::ComponentType::DAY_OF_MONTH, 1) in TEST_F()
[all …]
Dextractor.cc36 DatetimeComponent::ComponentType component_type; in Extract()
37 DatetimeComponent::RelativeQualifier relative_qualifier = in Extract()
38 DatetimeComponent::RelativeQualifier::UNSPECIFIED; in Extract()
64 result->SetAbsoluteValue(DatetimeComponent::ComponentType::YEAR, year); in Extract()
73 result->SetAbsoluteValue(DatetimeComponent::ComponentType::MONTH, in Extract()
83 result->SetAbsoluteValue(DatetimeComponent::ComponentType::DAY_OF_MONTH, in Extract()
93 result->SetAbsoluteValue(DatetimeComponent::ComponentType::HOUR, hour); in Extract()
103 result->SetAbsoluteValue(DatetimeComponent::ComponentType::MINUTE, in Extract()
113 result->SetAbsoluteValue(DatetimeComponent::ComponentType::SECOND, in Extract()
123 result->SetAbsoluteValue(DatetimeComponent::ComponentType::MERIDIEM, in Extract()
[all …]
Ddatetime-grounder.cc86 StatusOr<DatetimeComponent::RelativeQualifier> ToRelativeQualifier( in ToRelativeQualifier()
90 return DatetimeComponent::RelativeQualifier::THIS; in ToRelativeQualifier()
92 return DatetimeComponent::RelativeQualifier::LAST; in ToRelativeQualifier()
94 return DatetimeComponent::RelativeQualifier::NEXT; in ToRelativeQualifier()
96 return DatetimeComponent::RelativeQualifier::NOW; in ToRelativeQualifier()
98 return DatetimeComponent::RelativeQualifier::TOMORROW; in ToRelativeQualifier()
100 return DatetimeComponent::RelativeQualifier::YESTERDAY; in ToRelativeQualifier()
102 return DatetimeComponent::RelativeQualifier::PAST; in ToRelativeQualifier()
104 return DatetimeComponent::RelativeQualifier::FUTURE; in ToRelativeQualifier()
106 return DatetimeComponent::RelativeQualifier::UNSPECIFIED; in ToRelativeQualifier()
[all …]
Dutils.cc28 if (parse.HasFieldType(DatetimeComponent::ComponentType::DAY_OF_WEEK)) { in FillInterpretations()
29 DatetimeComponent::RelativeQualifier relative_value; in FillInterpretations()
30 if (parse.GetRelativeValue(DatetimeComponent::ComponentType::DAY_OF_WEEK, in FillInterpretations()
32 if (relative_value == DatetimeComponent::RelativeQualifier::UNSPECIFIED) { in FillInterpretations()
34 DatetimeComponent::ComponentType::DAY_OF_WEEK, in FillInterpretations()
35 DatetimeComponent::RelativeQualifier::THIS); in FillInterpretations()
43 modified_parse.HasFieldType(DatetimeComponent::ComponentType::HOUR) && in FillInterpretations()
45 DatetimeComponent::ComponentType::HOUR) && in FillInterpretations()
47 DatetimeComponent::ComponentType::MERIDIEM)) { in FillInterpretations()
49 modified_parse.GetFieldValue(DatetimeComponent::ComponentType::HOUR, in FillInterpretations()
[all …]
Ddatetime-grounder_test.cc121 DatetimeComponent::ComponentType::MERIDIEM); in TEST_F()
125 DatetimeComponent::ComponentType::SECOND); in TEST_F()
127 DatetimeComponent::ComponentType::SECOND); in TEST_F()
130 DatetimeComponent::ComponentType::MINUTE); in TEST_F()
134 DatetimeComponent::ComponentType::HOUR); in TEST_F()
138 DatetimeComponent::ComponentType::DAY_OF_MONTH); in TEST_F()
142 DatetimeComponent::ComponentType::MONTH); in TEST_F()
146 DatetimeComponent::ComponentType::YEAR); in TEST_F()
168 DatetimeComponent::ComponentType::MERIDIEM); in TEST_F()
171 DatetimeComponent::ComponentType::MERIDIEM); in TEST_F()
[all …]
Dextractor.h92 DatetimeComponent::RelativeQualifier* parsed_relative_value) const;
97 DatetimeComponent::ComponentType* parsed_field_type) const;
110 std::unordered_map<DatetimeComponent::ComponentType, int>* values) const;
Dregex-parser.cc379 std::vector<DatetimeComponent> date_components; in ExtractDatetime()
398 [](DatetimeComponent a, DatetimeComponent b) { in ExtractDatetime()
/external/libtextclassifier/native/annotator/
Dtypes.cc50 bool DatetimeComponent::ShouldRoundToGranularity() const { in ShouldRoundToGranularity()
79 const DatetimeComponent::ComponentType& component_type) { in ComponentTypeToString()
81 case DatetimeComponent::ComponentType::UNSPECIFIED: in ComponentTypeToString()
83 case DatetimeComponent::ComponentType::YEAR: in ComponentTypeToString()
85 case DatetimeComponent::ComponentType::MONTH: in ComponentTypeToString()
87 case DatetimeComponent::ComponentType::WEEK: in ComponentTypeToString()
89 case DatetimeComponent::ComponentType::DAY_OF_WEEK: in ComponentTypeToString()
91 case DatetimeComponent::ComponentType::DAY_OF_MONTH: in ComponentTypeToString()
93 case DatetimeComponent::ComponentType::HOUR: in ComponentTypeToString()
95 case DatetimeComponent::ComponentType::MINUTE: in ComponentTypeToString()
[all …]
Dtypes.h268 struct DatetimeComponent { struct
313 bool operator==(const DatetimeComponent& other) const { argument
329 DatetimeComponent() = default; argument
331 explicit DatetimeComponent(ComponentType arg_component_type, in DatetimeComponent() function
343 const std::vector<DatetimeComponent>& datetime_component);
346 Optional<DatetimeComponent> GetDatetimeComponent(
347 const std::vector<DatetimeComponent>& datetime_components,
348 const DatetimeComponent::ComponentType& component_type);
358 std::vector<DatetimeComponent> datetime_components;
364 std::vector<DatetimeComponent> arg_datetime__components) in DatetimeParseResult()
[all …]
Dflatbuffer-utils.cc84 DatetimeComponent::RelativeQualifier::UNSPECIFIED) { in CreateDatetimeSerializedEntityData()
Dentity-data.fbs62 table DatetimeComponent {
73 datetime_component:[Datetime_.DatetimeComponent];
/external/libtextclassifier/native/utils/calendar/
Dcalendar_test.cc48 data.SetAbsoluteValue(DatetimeComponent::ComponentType::YEAR, 2018); in TEST_F()
69 data.SetAbsoluteValue(DatetimeComponent::ComponentType::YEAR, 2018); in TEST_F()
70 data.SetAbsoluteValue(DatetimeComponent::ComponentType::HOUR, 7); in TEST_F()
71 data.SetAbsoluteValue(DatetimeComponent::ComponentType::MINUTE, 30); in TEST_F()
72 data.SetAbsoluteValue(DatetimeComponent::ComponentType::SECOND, 10); in TEST_F()
81 data.SetAbsoluteValue(DatetimeComponent::ComponentType::ZONE_OFFSET, in TEST_F()
92 data.SetAbsoluteValue(DatetimeComponent::ComponentType::ZONE_OFFSET, in TEST_F()
107 data.SetAbsoluteValue(DatetimeComponent::ComponentType::YEAR, 2018); in TEST_F()
115 data.SetAbsoluteValue(DatetimeComponent::ComponentType::MONTH, 4); in TEST_F()
123 data.SetAbsoluteValue(DatetimeComponent::ComponentType::DAY_OF_MONTH, 25); in TEST_F()
[all …]
Dcalendar-common.h53 bool ApplyRelationField(const DatetimeComponent& relative_date_time_component,
68 bool AdjustByRelation(DatetimeComponent date_time_component, int distance,
73 std::vector<DatetimeComponent> components; in HasOnlyTimeComponents()
76 for (const DatetimeComponent& component : components) { in HasOnlyTimeComponents()
77 if (!(component.component_type == DatetimeComponent::ComponentType::HOUR || in HasOnlyTimeComponents()
79 DatetimeComponent::ComponentType::MINUTE || in HasOnlyTimeComponents()
81 DatetimeComponent::ComponentType::SECOND || in HasOnlyTimeComponents()
83 DatetimeComponent::ComponentType::MERIDIEM)) { in HasOnlyTimeComponents()
104 if (parse_data.HasFieldType(DatetimeComponent::ComponentType::ZONE_OFFSET)) { in InterpretParseData()
106 parse_data.GetFieldValue(DatetimeComponent::ComponentType::ZONE_OFFSET, in InterpretParseData()
[all …]
/external/libtextclassifier/native/annotator/datetime/testing/
Ddatetime-component-builder.cc22 DatetimeComponent::ComponentType type, int value) { in Add()
23 DatetimeComponent component; in Add()
30 DatetimeComponent::ComponentType type, int value, in Add()
31 DatetimeComponent::RelativeQualifier relative_qualifier, in Add()
33 DatetimeComponent component; in Add()
41 std::vector<DatetimeComponent> DatetimeComponentsBuilder::Build() { in Build()
46 const DatetimeComponent& datetime_component) { in AddComponent()
Ddatetime-component-builder.h27 DatetimeComponentsBuilder Add(DatetimeComponent::ComponentType type,
31 DatetimeComponent::ComponentType type, int value,
32 DatetimeComponent::RelativeQualifier relative_qualifier,
35 std::vector<DatetimeComponent> Build();
39 const DatetimeComponent& datetime_component);
40 std::vector<DatetimeComponent> datetime_components_;
Dbase-parser-test.h42 std::vector<std::vector<DatetimeComponent>> datetime_components,
52 std::vector<std::vector<DatetimeComponent>> datetime_components,
63 std::vector<std::vector<DatetimeComponent>> datetime_components);
68 std::vector<std::vector<DatetimeComponent>> datetime_components);
73 std::vector<std::vector<DatetimeComponent>> datetime_components);
Dbase-parser-test.cc50 vector<vector<DatetimeComponent>> datetime_components, in ParsesCorrectly()
123 vector<vector<DatetimeComponent>> datetime_components, in ParsesCorrectly()
135 vector<vector<DatetimeComponent>> datetime_components) { in ParsesCorrectlyGerman()
145 vector<vector<DatetimeComponent>> datetime_components) { in ParsesCorrectlyGerman()
155 vector<vector<DatetimeComponent>> datetime_components) { in ParsesCorrectlyChinese()
/external/libtextclassifier/native/actions/
Dutils.cc143 for (const DatetimeComponent& component : in ConvertDatetimeToTime()
146 DatetimeComponent::ComponentType::UNSPECIFIED && in ConvertDatetimeToTime()
147 component.component_type < DatetimeComponent::ComponentType::HOUR) { in ConvertDatetimeToTime()