xref: /aosp_15_r20/external/libtextclassifier/native/annotator/contact/contact-engine-dummy.h (revision 993b0882672172b81d12fad7a7ac0c3e5c824a12)
1*993b0882SAndroid Build Coastguard Worker /*
2*993b0882SAndroid Build Coastguard Worker  * Copyright (C) 2018 The Android Open Source Project
3*993b0882SAndroid Build Coastguard Worker  *
4*993b0882SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*993b0882SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*993b0882SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*993b0882SAndroid Build Coastguard Worker  *
8*993b0882SAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*993b0882SAndroid Build Coastguard Worker  *
10*993b0882SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*993b0882SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*993b0882SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*993b0882SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*993b0882SAndroid Build Coastguard Worker  * limitations under the License.
15*993b0882SAndroid Build Coastguard Worker  */
16*993b0882SAndroid Build Coastguard Worker 
17*993b0882SAndroid Build Coastguard Worker #ifndef LIBTEXTCLASSIFIER_ANNOTATOR_CONTACT_CONTACT_ENGINE_DUMMY_H_
18*993b0882SAndroid Build Coastguard Worker #define LIBTEXTCLASSIFIER_ANNOTATOR_CONTACT_CONTACT_ENGINE_DUMMY_H_
19*993b0882SAndroid Build Coastguard Worker 
20*993b0882SAndroid Build Coastguard Worker #include <string>
21*993b0882SAndroid Build Coastguard Worker #include <vector>
22*993b0882SAndroid Build Coastguard Worker 
23*993b0882SAndroid Build Coastguard Worker #include "annotator/feature-processor.h"
24*993b0882SAndroid Build Coastguard Worker #include "annotator/model_generated.h"
25*993b0882SAndroid Build Coastguard Worker #include "annotator/types.h"
26*993b0882SAndroid Build Coastguard Worker #include "utils/base/logging.h"
27*993b0882SAndroid Build Coastguard Worker #include "utils/utf8/unicodetext.h"
28*993b0882SAndroid Build Coastguard Worker #include "utils/utf8/unilib.h"
29*993b0882SAndroid Build Coastguard Worker 
30*993b0882SAndroid Build Coastguard Worker namespace libtextclassifier3 {
31*993b0882SAndroid Build Coastguard Worker 
32*993b0882SAndroid Build Coastguard Worker // A dummy implementation of the contact engine.
33*993b0882SAndroid Build Coastguard Worker class ContactEngine {
34*993b0882SAndroid Build Coastguard Worker  public:
ContactEngine(const FeatureProcessor * feature_processor,const UniLib * unilib,const ContactAnnotatorOptions * options)35*993b0882SAndroid Build Coastguard Worker   explicit ContactEngine(const FeatureProcessor* feature_processor,
36*993b0882SAndroid Build Coastguard Worker                          const UniLib* unilib,
37*993b0882SAndroid Build Coastguard Worker                          const ContactAnnotatorOptions* options) {}
38*993b0882SAndroid Build Coastguard Worker 
Initialize(const std::string & serialized_config)39*993b0882SAndroid Build Coastguard Worker   bool Initialize(const std::string& serialized_config) {
40*993b0882SAndroid Build Coastguard Worker     TC3_LOG(ERROR) << "No contact engine to initialize.";
41*993b0882SAndroid Build Coastguard Worker     return false;
42*993b0882SAndroid Build Coastguard Worker   }
43*993b0882SAndroid Build Coastguard Worker 
ClassifyText(const std::string & context,CodepointSpan selection_indices,ClassificationResult * classification_result)44*993b0882SAndroid Build Coastguard Worker   bool ClassifyText(const std::string& context, CodepointSpan selection_indices,
45*993b0882SAndroid Build Coastguard Worker                     ClassificationResult* classification_result) const {
46*993b0882SAndroid Build Coastguard Worker     return false;
47*993b0882SAndroid Build Coastguard Worker   }
48*993b0882SAndroid Build Coastguard Worker 
Chunk(const UnicodeText & context_unicode,const std::vector<Token> & tokens,ModeFlag mode,std::vector<AnnotatedSpan> * result)49*993b0882SAndroid Build Coastguard Worker   bool Chunk(const UnicodeText& context_unicode,
50*993b0882SAndroid Build Coastguard Worker              const std::vector<Token>& tokens, ModeFlag mode,
51*993b0882SAndroid Build Coastguard Worker              std::vector<AnnotatedSpan>* result) const {
52*993b0882SAndroid Build Coastguard Worker     return true;
53*993b0882SAndroid Build Coastguard Worker   }
54*993b0882SAndroid Build Coastguard Worker 
AddContactMetadataToKnowledgeClassificationResult(ClassificationResult * classification_result)55*993b0882SAndroid Build Coastguard Worker   void AddContactMetadataToKnowledgeClassificationResult(
56*993b0882SAndroid Build Coastguard Worker       ClassificationResult* classification_result) const {}
57*993b0882SAndroid Build Coastguard Worker 
CleanUp()58*993b0882SAndroid Build Coastguard Worker   void CleanUp() const {}
59*993b0882SAndroid Build Coastguard Worker };
60*993b0882SAndroid Build Coastguard Worker 
61*993b0882SAndroid Build Coastguard Worker }  // namespace libtextclassifier3
62*993b0882SAndroid Build Coastguard Worker 
63*993b0882SAndroid Build Coastguard Worker #endif  // LIBTEXTCLASSIFIER_ANNOTATOR_CONTACT_CONTACT_ENGINE_DUMMY_H_
64