| 39 | static const std::vector<string> kBlacklistNgram = {"<S>", "<E>", "<S> <E>"}; |
| 40 | |
| 41 | bool Equals(const string& x, const tflite::StringRef& strref) { |
| 42 | if (strref.len != x.length()) { |
| 43 | return false; |
| 44 | } |
| 45 | if (strref.len > 0) { |
| 46 | int r = memcmp(strref.str, x.data(), strref.len); |
| 47 | return r == 0; |
| 48 | } |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | bool IsValidNgram(const tflite::StringRef& strref) { |
| 53 | for (const auto& s : kBlacklistNgram) { |
no test coverage detected