• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 #ifndef LIBTEXTCLASSIFIER_ANNOTATOR_EXPERIMENTAL_EXPERIMENTAL_DUMMY_H_
18 #define LIBTEXTCLASSIFIER_ANNOTATOR_EXPERIMENTAL_EXPERIMENTAL_DUMMY_H_
19 
20 #include <string>
21 #include <vector>
22 
23 #include "annotator/feature-processor.h"
24 #include "annotator/types.h"
25 #include "utils/utf8/unicodetext.h"
26 #include "utils/utf8/unilib.h"
27 
28 namespace libtextclassifier3 {
29 
30 class ExperimentalAnnotator {
31  public:
32   // This is the dummy implementation of ExperimentalAnnotator and so it's
33   // always disabled;
IsEnabled()34   static constexpr bool IsEnabled() { return false; }
35 
ExperimentalAnnotator(const ExperimentalModel * model,const FeatureProcessor & feature_processor,const UniLib & unilib)36   explicit ExperimentalAnnotator(const ExperimentalModel* model,
37                                  const FeatureProcessor& feature_processor,
38                                  const UniLib& unilib) {}
39 
Annotate(const UnicodeText & context,std::vector<AnnotatedSpan> * candidates)40   bool Annotate(const UnicodeText& context,
41                 std::vector<AnnotatedSpan>* candidates) const {
42     return true;
43   }
44 
SuggestSelection(const UnicodeText & context,CodepointSpan click)45   AnnotatedSpan SuggestSelection(const UnicodeText& context,
46                                  CodepointSpan click) const {
47     return {click, {}};
48   }
49 
ClassifyText(const UnicodeText & context,CodepointSpan selection_indices,std::vector<AnnotatedSpan> & candidates)50   bool ClassifyText(const UnicodeText& context, CodepointSpan selection_indices,
51                     std::vector<AnnotatedSpan>& candidates) const {
52     return false;
53   }
54 };
55 
56 }  // namespace libtextclassifier3
57 
58 #endif  // LIBTEXTCLASSIFIER_ANNOTATOR_EXPERIMENTAL_EXPERIMENTAL_DUMMY_H_
59