|
1 |
| -#include "tesseract/training/normstrngs.h" |
| 1 | +// (C) Copyright 2017, Google Inc. |
| 2 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +// you may not use this file except in compliance with the License. |
| 4 | +// You may obtain a copy of the License at |
| 5 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +// Unless required by applicable law or agreed to in writing, software |
| 7 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 8 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 9 | +// See the License for the specific language governing permissions and |
| 10 | +// limitations under the License. |
2 | 11 |
|
3 |
| -#include "tesseract/unittest/normstrngs_test.h" |
| 12 | +#include "include_gunit.h" |
| 13 | +#include "normstrngs.h" |
| 14 | +#include "normstrngs_test.h" |
4 | 15 |
|
5 | 16 | namespace tesseract {
|
6 | 17 | namespace {
|
7 | 18 |
|
8 | 19 | // Test some random Myanmar words.
|
9 | 20 | TEST(ValidateMyanmarTest, GoodMyanmarWords) {
|
10 |
| - string str = "လျှာကသိသည် "; // No viramas in this one. |
| 21 | + std::string str = "လျှာကသိသည် "; // No viramas in this one. |
11 | 22 | ExpectGraphemeModeResults(str, UnicodeNormMode::kNFC, 11, 11, 5, str);
|
12 | 23 | str = "တုန္လႈပ္မႈ ";
|
13 | 24 | ExpectGraphemeModeResults(str, UnicodeNormMode::kNFC, 11, 9, 4, str);
|
14 | 25 | }
|
15 | 26 |
|
16 | 27 | // Test some random Myanmar words with dotted circles.
|
17 | 28 | TEST(ValidateMyanmarTest, BadMyanmarWords) {
|
18 |
| - string str = "က်န္းမာေရး"; |
19 |
| - std::vector<string> glyphs; |
| 29 | + std::string str = "က်န္းမာေရး"; |
| 30 | + std::vector<std::string> glyphs; |
20 | 31 | EXPECT_FALSE(NormalizeCleanAndSegmentUTF8(
|
21 | 32 | UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNormMode::kCombined, true,
|
22 | 33 | str.c_str(), &glyphs));
|
23 |
| - string result; |
| 34 | + std::string result; |
24 | 35 | EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone,
|
25 | 36 | GraphemeNorm::kNormalize, str.c_str(),
|
26 | 37 | &result));
|
|
0 commit comments