Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: components/translate/core/language_detection/chinese_script_classifier.h

Issue 2743843002: Implements ChineseScriptClassifier functionality without icu::Transliterator (Closed)
Patch Set: Removes references to unused translit.h Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/core/language_detection/chinese_script_classifier.h
diff --git a/components/translate/core/language_detection/chinese_script_classifier.h b/components/translate/core/language_detection/chinese_script_classifier.h
index 1063063fd40610c4a23e38e36f70d07c952406db..f93cc3c1f3caff503e8b1ec6a97e67682ffa70bb 100644
--- a/components/translate/core/language_detection/chinese_script_classifier.h
+++ b/components/translate/core/language_detection/chinese_script_classifier.h
@@ -7,14 +7,14 @@
#include <memory>
#include <string>
-#include "third_party/icu/source/i18n/unicode/translit.h"
+#include "third_party/icu/source/common/unicode/uniset.h"
namespace translate {
class ChineseScriptClassifier {
public:
- // Initializes both the Hant-to-Hans ICU transliterator and the
- // Hans-to-Hant ICU transliterator.
+ // Initializes both the zh-Hans and zh-Hant UnicodeSets used for
+ // lookup when Classify is called.
ChineseScriptClassifier();
~ChineseScriptClassifier();
@@ -31,11 +31,11 @@ class ChineseScriptClassifier {
bool IsInitialized() const;
private:
- // ICU Transliterator that does Hans to Hant conversion.
- std::unique_ptr<icu::Transliterator> hans2hant_;
+ // Set of chars generally unique to zh-Hans.
+ std::unique_ptr<icu::UnicodeSet> hans_set_;
- // ICU Transliterator that does Hant to Hans conversion.
- std::unique_ptr<icu::Transliterator> hant2hans_;
+ // Set of chars generally unique to zh-Hant.
+ std::unique_ptr<icu::UnicodeSet> hant_set_;
};
} // namespace translate

Powered by Google App Engine
This is Rietveld 408576698