vChewing-macOS/Source/Engine
Lukhnos Liu d6cc5479f6 Use a more tolerant parser for user phrases
A generic key-value blob reader, KeyValueBlobReader, is implemented to
allow more flexibility in user-editable files. For example, this allows
comments in the file, as well as tolerating leading or trailing spaces,
tabs, or even Windows CR LF line endings.

Unit tests are supplied for KeyValueBlobReader although they are not
part of the Xcode project. A separate CMakeLists.txt is provided.

UserPhrasesLM is refactored to use KeyValueBlobReader. A small stylistic
change is appiled to reduce "using namespace" uses, but otherwise no
major style changes were applied to UserPhrasesLM.

Please note that McBopomofo's user phrase LM uses the value in a
key-value pair as the reading, and the key as the actual "value". We
don't plan to change that order so that we don't have to migrate data.

std::string_view is used to allow efficient reference to char buffers
and interop with std::string (and so no c_str() is needed). C++17 is now
enabled for the project to enable the use of std::string_view.

Copyright headers are added to McBopomofoLM and UserPhrasesLM.
2022-01-13 23:27:31 -08:00
..
Gramambular Removes unused code and fixes a typo. 2022-01-12 13:16:10 +08:00
Mandarin Enable IBM Keyboard Layout, no update to xib yet 2012-11-13 00:40:26 -08:00
OpenVanilla first commit 2011-09-01 23:56:26 -07:00
.gitignore Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
CMakeLists.txt Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
FastLM.cpp Adds McBopomofoLM as the facade of three language models. 2022-01-12 12:26:24 +08:00
FastLM.h Adds McBopomofoLM as the facade of three language models. 2022-01-12 12:26:24 +08:00
KeyValueBlobReader.cpp Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
KeyValueBlobReader.h Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
KeyValueBlobReaderTest.cpp Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
McBopomofoLM.cpp Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
McBopomofoLM.h Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
UserOverrideModel.cpp Converts the preference and non modal view controller to Swift. 2022-01-10 22:01:40 +08:00
UserOverrideModel.h Converts the preference and non modal view controller to Swift. 2022-01-10 22:01:40 +08:00
UserPhrasesLM.cpp Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00
UserPhrasesLM.h Use a more tolerant parser for user phrases 2022-01-13 23:27:31 -08:00