Skip to content

Commit 50f57a1

Browse files
committed
fix
1 parent 3dc125a commit 50f57a1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

include/timbl/TimblExperiment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ namespace Timbl {
197197
double confidence() const { return bestResult.confidence(); };
198198
bool matchedAtLeaf() const { return last_leaf; };
199199

200-
nlohmann::json classify_to_JSON( const icu::UnicodeString& );
201-
nlohmann::json classify_to_JSON( const std::vector<icu::UnicodeString>& );
200+
nlohmann::json classify_to_JSON( const std::string& );
201+
nlohmann::json classify_to_JSON( const std::vector<std::string>& );
202202

203203
virtual AlgorithmType Algorithm() const = 0;
204204
const TargetValue *Classify( const icu::UnicodeString& Line,

src/TimblExperiment.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,10 +1537,11 @@ namespace Timbl {
15371537
return true;
15381538
}
15391539

1540-
json TimblExperiment::classify_to_JSON( const UnicodeString& inst ) {
1540+
json TimblExperiment::classify_to_JSON( const string& inst ) {
15411541
json result;
15421542
double distance = 0.0;
1543-
const TargetValue *targ = classifyString( inst, distance );
1543+
const TargetValue *targ = classifyString( TiCC::UnicodeFromUTF8(inst),
1544+
distance );
15441545
if ( targ ){
15451546
string cat = targ->Name();
15461547
normalizeResult();
@@ -1577,7 +1578,7 @@ namespace Timbl {
15771578
return result;
15781579
}
15791580

1580-
json TimblExperiment::classify_to_JSON( const vector<UnicodeString>& instances ) {
1581+
json TimblExperiment::classify_to_JSON( const vector<string>& instances ) {
15811582
json result = json::array();
15821583
for ( const auto& i : instances ){
15831584
json tmp = classify_to_JSON( i );

0 commit comments

Comments
 (0)