Roll forward (ag/3652360): Adds a few boundary-condition checks, and updates the default model not to contain regexes that cause the ICU regex interpreter to hang.
- the core problem was wrong version of the model
- this went through because I was unaware of the difference between coretests and cts (so should this arise next time, it should be caught at my machine locally, and latest in presubmit robot that now runs the right tests cr/187097855)
Bugs: 73758981
Bugs: 73849149
Test: Tested on device. CTS and core tests pass.
bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Change-Id: I82f7aeaa7fbe3af6c043ec055686efae0d2e9383
diff --git a/model.fbs b/model.fbs
index 632703c..2d69fe7 100755
--- a/model.fbs
+++ b/model.fbs
@@ -1,3 +1,19 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
file_identifier "TC2 ";
namespace libtextclassifier2;
@@ -125,7 +141,7 @@
// The final score to assign to the results of this pattern.
target_classification_score:float = 1;
- // Priority score used for conflict resulution with the other models.
+ // Priority score used for conflict resolution with the other models.
priority_score:float = 0;
}
@@ -198,6 +214,9 @@
// Options controlling the output of the models.
triggering_options:libtextclassifier2.ModelTriggeringOptions;
+
+ // A name for the model that can be used for e.g. logging.
+ name:string;
}
// Role of the codepoints in the range.
@@ -274,7 +293,7 @@
end:int;
}
-// Bounds-sensitive feature extraction configuration go/tc-bounds-sensitive.
+// Bounds-sensitive feature extraction configuration.
namespace libtextclassifier2.FeatureProcessorOptions_;
table BoundsSensitiveFeatures {
// Enables the extraction of bounds-sensitive features, instead of the click
@@ -310,9 +329,6 @@
value:string;
}
-// TC_STRIP
-// Next ID: 44
-// TC_END_STRIP
namespace libtextclassifier2;
table FeatureProcessorOptions {
// Number of buckets used for hashing charactergrams.