unittest/validate_khmer_test.cc
TEST(ValidateKhmerTest, BadKhmerWords) {
  std::string result;
  // Multiple dependent vowels not allowed
  std::string str = "\u1796\u17b6\u17b7";
  EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNorm::kNormalize,
                                   str.c_str(), &result));
  // Multiple shifters not allowed
  str = "\u1798\u17c9\u17ca";
  EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNorm::kNormalize,
                                   str.c_str(), &result));
  // Multiple signs not allowed
  str = "\u1780\u17b6\u17cb\u17cd";
  EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNorm::kNormalize,
                                   str.c_str(), &result));
}
// Test some random Khmer words with dotted circles.
Test some random Khmer words with dotted circles.
Test some random Khmer words with dotted circles .
TEST(ValidateKhmerTest, BadKhmerWords) {
  std::string result;
  std::string str = "\u1796\u17b6\u17b7";
  EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNorm::kNormalize,
                                   str.c_str(), &result));
  str = "\u1798\u17c9\u17ca";
  EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNorm::kNormalize,
                                   str.c_str(), &result));
  str = "\u1780\u17b6\u17cb\u17cd";
  EXPECT_FALSE(NormalizeUTF8String(UnicodeNormMode::kNFC, OCRNorm::kNone, GraphemeNorm::kNormalize,
                                   str.c_str(), &result));
}
TEST ( ValidateKhmerTest , BadKhmerWords ) { std :: string result ; std :: string str = " \u1796 \u17b6 \u17b7 " ; EXPECT_FALSE ( NormalizeUTF8String ( UnicodeNormMode :: kNFC , OCRNorm :: kNone , GraphemeNorm :: kNormalize , str . c_str ( ) , & result ) ) ; str = " \u1798 \u17c9 \u17ca " ; EXPECT_FALSE ( NormalizeUTF8String ( UnicodeNormMode :: kNFC , OCRNorm :: kNone , GraphemeNorm :: kNormalize , str . c_str ( ) , & result ) ) ; str = " \u1780 \u17b6 \u17cb \u17cd " ; EXPECT_FALSE ( NormalizeUTF8String ( UnicodeNormMode :: kNFC , OCRNorm :: kNone , GraphemeNorm :: kNormalize , str . c_str ( ) , & result ) ) ; }
Test some random Khmer words with dotted circles.
Test some random Khmer words with dotted circles .
// Multiple dependent vowels not allowed // Multiple shifters not allowed // Multiple signs not allowed