1// 2// Copyright (C) 2018 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17namespace libtextclassifier3.EntityData_.Datetime_; 18enum Granularity : int { 19 GRANULARITY_UNKNOWN = -1, 20 GRANULARITY_YEAR = 0, 21 GRANULARITY_MONTH = 1, 22 GRANULARITY_WEEK = 2, 23 GRANULARITY_DAY = 3, 24 GRANULARITY_HOUR = 4, 25 GRANULARITY_MINUTE = 5, 26 GRANULARITY_SECOND = 6, 27} 28 29namespace libtextclassifier3.EntityData_; 30table Datetime { 31 time_ms_utc:long; 32 granularity:Datetime_.Granularity = GRANULARITY_UNKNOWN; 33} 34 35namespace libtextclassifier3.EntityData_; 36table Contact { 37 name:string; 38 given_name:string; 39 nickname:string; 40 email_address:string; 41 phone_number:string; 42 contact_id:string; 43} 44 45namespace libtextclassifier3.EntityData_; 46table App { 47 name:string; 48 package_name:string; 49} 50 51// Represents an entity annotated in text. 52namespace libtextclassifier3; 53table EntityData { 54 // Codepoint indices of the annotation, start is inclusive, end is 55 // exclusive. 56 start:int; 57 58 end:int; 59 60 // The entity type, as in the TextClassifier APIs. 61 type:string; 62 63 datetime:EntityData_.Datetime; 64 reserved_5:int (deprecated); 65 contact:EntityData_.Contact; 66 app:EntityData_.App; 67} 68 69root_type libtextclassifier3.EntityData; 70