Lets McBopomofoLM to accept NULL as the parameter in loadUserPhrases.
This commit is contained in:
parent
84fc2f068b
commit
f1e56a7e01
|
@ -18,17 +18,23 @@ McBopomofoLM::~McBopomofoLM()
|
||||||
|
|
||||||
void McBopomofoLM::loadLanguageModel(const char* languageModelDataPath)
|
void McBopomofoLM::loadLanguageModel(const char* languageModelDataPath)
|
||||||
{
|
{
|
||||||
m_languageModel.close();
|
if (languageModelDataPath) {
|
||||||
m_languageModel.open(languageModelDataPath);
|
m_languageModel.close();
|
||||||
|
m_languageModel.open(languageModelDataPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void McBopomofoLM::loadUserPhrases(const char* userPhrasesDataPath,
|
void McBopomofoLM::loadUserPhrases(const char* userPhrasesDataPath,
|
||||||
const char* excludedPhrasesDataPath)
|
const char* excludedPhrasesDataPath)
|
||||||
{
|
{
|
||||||
m_userPhrases.close();
|
if (userPhrasesDataPath) {
|
||||||
m_userPhrases.open(userPhrasesDataPath);
|
m_userPhrases.close();
|
||||||
m_excludedPhrases.close();
|
m_userPhrases.open(userPhrasesDataPath);
|
||||||
m_excludedPhrases.open(excludedPhrasesDataPath);
|
}
|
||||||
|
if (excludedPhrasesDataPath) {
|
||||||
|
m_excludedPhrases.close();
|
||||||
|
m_excludedPhrases.open(excludedPhrasesDataPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const vector<Bigram> McBopomofoLM::bigramsForKeys(const string& preceedingKey, const string& key)
|
const vector<Bigram> McBopomofoLM::bigramsForKeys(const string& preceedingKey, const string& key)
|
||||||
|
|
|
@ -35,7 +35,7 @@ static void LTLoadLanguageModelFile(NSString *filenameWithoutExtension, McBopomo
|
||||||
+ (void)loadUserPhrasesModel
|
+ (void)loadUserPhrasesModel
|
||||||
{
|
{
|
||||||
gLanguageModelMcBopomofo.loadUserPhrases([[self userPhrasesDataPathMcBopomofo] UTF8String], [[self excludedPhrasesDataPathMcBopomofo] UTF8String]);
|
gLanguageModelMcBopomofo.loadUserPhrases([[self userPhrasesDataPathMcBopomofo] UTF8String], [[self excludedPhrasesDataPathMcBopomofo] UTF8String]);
|
||||||
gLanguageModelPlainBopomofo.loadUserPhrases("", [[self excludedPhrasesDataPathPlainBopomofo] UTF8String]);
|
gLanguageModelPlainBopomofo.loadUserPhrases(NULL, [[self excludedPhrasesDataPathPlainBopomofo] UTF8String]);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)checkIfUserDataFolderExists
|
+ (BOOL)checkIfUserDataFolderExists
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||||
//
|
//
|
||||||
|
|
||||||
//extern void LTLoadLanguageModel(void);
|
|
||||||
//extern void LTLoadUserLanguageModelFile(void);
|
|
||||||
|
|
||||||
@import Foundation;
|
@import Foundation;
|
||||||
|
|
||||||
@interface LanguageModelManager : NSObject
|
@interface LanguageModelManager : NSObject
|
||||||
|
|
Loading…
Reference in New Issue