Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/tesseract/src/training/unicharset/validate_khmer.h @ 3:2c135c81b16c
MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:44:09 +0200 |
| parents | b50eed0cc0ef |
| children |
comparison
equal
deleted
inserted
replaced
| 0:6015a75abc2d | 3:2c135c81b16c |
|---|---|
| 1 #ifndef TESSERACT_TRAINING_VALIDATE_KHMER_H_ | |
| 2 #define TESSERACT_TRAINING_VALIDATE_KHMER_H_ | |
| 3 | |
| 4 #include "validator.h" | |
| 5 | |
| 6 namespace tesseract { | |
| 7 | |
| 8 // Subclass of Validator that validates and segments Khmer. | |
| 9 class ValidateKhmer : public Validator { | |
| 10 public: | |
| 11 ValidateKhmer(ViramaScript script, bool report_errors) : Validator(script, report_errors) {} | |
| 12 ~ValidateKhmer() override = default; | |
| 13 | |
| 14 protected: | |
| 15 // Returns whether codes matches the pattern for an Khmer Grapheme. | |
| 16 // Consumes the next Grapheme in codes_[codes_used_++...] and copies it to | |
| 17 // parts_ and output_. Returns true if a valid Grapheme was consumed, | |
| 18 // otherwise does not increment codes_used_. | |
| 19 bool ConsumeGraphemeIfValid() override; | |
| 20 // Returns the CharClass corresponding to the given Unicode ch. | |
| 21 CharClass UnicodeToCharClass(char32 ch) const override; | |
| 22 }; | |
| 23 | |
| 24 } // namespace tesseract | |
| 25 | |
| 26 #endif // TESSERACT_TRAINING_VALIDATE_KHMER_H_ |
