MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / LoadLexicon

Function LoadLexicon

data/dictionary/DictionaryPhraseSegmentationTest.cpp:34–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34LexiconPtr LoadLexicon(const std::string& path) {
35 FILE* fp = OpenFile(path);
36 EXPECT_NE(fp, nullptr) << path;
37 if (fp == nullptr) {
38 return LexiconPtr();
39 }
40 return Lexicon::ParseLexiconFromFile(fp);
41}
42
43bool HasAtLeastTwoCharacters(const std::string& text) {
44 return UTF8Util::Length(text.c_str()) >= 2;

Calls 1

OpenFileFunction · 0.70

Tested by

no test coverage detected