Remove SimpleLM.
This commit is contained in:
parent
f710f382d9
commit
362801eb6c
|
@ -24,7 +24,6 @@
|
|||
6A0D4F0815FC0DA600ABF4B3 /* Bopomofo.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4EEF15FC0DA600ABF4B3 /* Bopomofo.tiff */; };
|
||||
6A0D4F0915FC0DA600ABF4B3 /* Bopomofo@2x.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4EF015FC0DA600ABF4B3 /* Bopomofo@2x.tiff */; };
|
||||
6A0D4F4515FC0EB100ABF4B3 /* Mandarin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4F2015FC0EB100ABF4B3 /* Mandarin.cpp */; };
|
||||
6A0D4F4615FC0EB100ABF4B3 /* SimpleLM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4315FC0EB100ABF4B3 /* SimpleLM.cpp */; };
|
||||
6A0D4F5215FC0EE100ABF4B3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4C15FC0EE100ABF4B3 /* MainMenu.xib */; };
|
||||
6A0D4F5315FC0EE100ABF4B3 /* preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4E15FC0EE100ABF4B3 /* preferences.xib */; };
|
||||
6A0D4F5715FC0EF900ABF4B3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4815FC0EE100ABF4B3 /* InfoPlist.strings */; };
|
||||
|
@ -147,8 +146,6 @@
|
|||
6A0D4F4015FC0EB100ABF4B3 /* OVTextBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OVTextBuffer.h; sourceTree = "<group>"; };
|
||||
6A0D4F4115FC0EB100ABF4B3 /* OVUTF8Helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OVUTF8Helper.h; sourceTree = "<group>"; };
|
||||
6A0D4F4215FC0EB100ABF4B3 /* OVWildcard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OVWildcard.h; sourceTree = "<group>"; };
|
||||
6A0D4F4315FC0EB100ABF4B3 /* SimpleLM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLM.cpp; sourceTree = "<group>"; };
|
||||
6A0D4F4415FC0EB100ABF4B3 /* SimpleLM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLM.h; sourceTree = "<group>"; };
|
||||
6A0D4F4915FC0EE100ABF4B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Source/en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6A0D4F4B15FC0EE100ABF4B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Source/en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
6A0D4F4D15FC0EE100ABF4B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = Source/en.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
|
@ -331,8 +328,6 @@
|
|||
6A0D4F1315FC0EB100ABF4B3 /* Gramambular */,
|
||||
6A0D4F1F15FC0EB100ABF4B3 /* Mandarin */,
|
||||
6A0D4F2215FC0EB100ABF4B3 /* OpenVanilla */,
|
||||
6A0D4F4315FC0EB100ABF4B3 /* SimpleLM.cpp */,
|
||||
6A0D4F4415FC0EB100ABF4B3 /* SimpleLM.h */,
|
||||
6A0421A615FEF3F50061ED63 /* FastLM.cpp */,
|
||||
6A0421A715FEF3F50061ED63 /* FastLM.h */,
|
||||
);
|
||||
|
@ -643,7 +638,6 @@
|
|||
6A0D4F0215FC0DA600ABF4B3 /* VTVerticalCandidateTableView.m in Sources */,
|
||||
6A0D4F0315FC0DA600ABF4B3 /* VTVerticalKeyLabelStripView.m in Sources */,
|
||||
6A0D4F4515FC0EB100ABF4B3 /* Mandarin.cpp in Sources */,
|
||||
6A0D4F4615FC0EB100ABF4B3 /* SimpleLM.cpp in Sources */,
|
||||
6A0421A815FEF3F50061ED63 /* FastLM.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
|
|
@ -71,7 +71,7 @@ bool FastLM::open(const char *path)
|
|||
return false;
|
||||
}
|
||||
|
||||
// we have 5 states
|
||||
// we have 4 states, plus end and error
|
||||
// 0
|
||||
// end -> end
|
||||
// lf -> forward, go to 0
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
//
|
||||
// SimpleLM.cpp
|
||||
//
|
||||
// Copyright (c) 2011 Lukhnos D. Liu (http://lukhnos.org)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the "Software"), to deal in the Software without
|
||||
// restriction, including without limitation the rights to use,
|
||||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following
|
||||
// conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#include "SimpleLM.h"
|
||||
|
||||
namespace Formosa {
|
||||
namespace Gramambular {
|
||||
|
||||
SimpleLM::SimpleLM()
|
||||
{
|
||||
}
|
||||
|
||||
void SimpleLM::add(const string &key, const string &value, double score)
|
||||
{
|
||||
Unigram u;
|
||||
u.keyValue.key = key;
|
||||
u.keyValue.value = value;
|
||||
u.score = score;
|
||||
m_db[key].push_back(u);
|
||||
}
|
||||
|
||||
const vector<Bigram> SimpleLM::bigramsForKeys(const string &preceedingKey, const string& key)
|
||||
{
|
||||
return vector<Bigram>();
|
||||
}
|
||||
|
||||
const vector<Unigram> SimpleLM::unigramsForKeys(const string &key)
|
||||
{
|
||||
map<string, vector<Unigram> >::const_iterator f = m_db.find(key);
|
||||
return f == m_db.end() ? vector<Unigram>() : (*f).second;
|
||||
}
|
||||
|
||||
bool SimpleLM::hasUnigramsForKey(const string& key)
|
||||
{
|
||||
map<string, vector<Unigram> >::const_iterator f = m_db.find(key);
|
||||
return f != m_db.end();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
//
|
||||
// SimpleLM.h
|
||||
//
|
||||
// Copyright (c) 2011 Lukhnos D. Liu (http://lukhnos.org)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the "Software"), to deal in the Software without
|
||||
// restriction, including without limitation the rights to use,
|
||||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following
|
||||
// conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#ifndef SIMPLELM_H
|
||||
#define SIMPLELM_H
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include "LanguageModel.h"
|
||||
|
||||
namespace Formosa {
|
||||
namespace Gramambular {
|
||||
class SimpleLM : public LanguageModel
|
||||
{
|
||||
public:
|
||||
SimpleLM();
|
||||
void add(const string &key, const string &value, double score);
|
||||
virtual const vector<Bigram> bigramsForKeys(const string &preceedingKey, const string& key);
|
||||
virtual const vector<Unigram> unigramsForKeys(const string &key);
|
||||
virtual bool hasUnigramsForKey(const string& key);
|
||||
|
||||
protected:
|
||||
map<string, vector<Unigram> > m_db;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -36,7 +36,6 @@
|
|||
#import <InputMethodKit/InputMethodKit.h>
|
||||
#import "Mandarin.h"
|
||||
#import "Gramambular.h"
|
||||
#import "SimpleLM.h"
|
||||
#import "FastLM.h"
|
||||
|
||||
@interface McBopomofoInputMethodController : IMKInputController
|
||||
|
|
Loading…
Reference in New Issue