cosmetic change and change the location of the user dictionary
This commit is contained in:
parent
da5d323082
commit
373c631036
|
@ -796,7 +796,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||||
<object class="NSButtonCell" key="NSCell" id="1041607992">
|
<object class="NSButtonCell" key="NSCell" id="1041607992">
|
||||||
<int key="NSCellFlags">-2080244224</int>
|
<int key="NSCellFlags">-2080244224</int>
|
||||||
<int key="NSCellFlags2">0</int>
|
<int key="NSCellFlags2">0</int>
|
||||||
<string key="NSContents">Use spce key to choose candidates</string>
|
<string key="NSContents">Use space key to choose candidates</string>
|
||||||
<reference key="NSSupport" ref="113866199"/>
|
<reference key="NSSupport" ref="113866199"/>
|
||||||
<string key="NSCellIdentifier">_NS:239</string>
|
<string key="NSCellIdentifier">_NS:239</string>
|
||||||
<reference key="NSControlView" ref="11182933"/>
|
<reference key="NSControlView" ref="11182933"/>
|
||||||
|
|
|
@ -286,6 +286,7 @@ public:
|
||||||
[_composingBuffer setString:@""];
|
[_composingBuffer setString:@""];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: bug #28 is more likely to live in this method.
|
||||||
- (void)updateClientComposingBuffer:(id)client
|
- (void)updateClientComposingBuffer:(id)client
|
||||||
{
|
{
|
||||||
// "updating the composing buffer" means to request the client to "refresh" the text input buffer
|
// "updating the composing buffer" means to request the client to "refresh" the text input buffer
|
||||||
|
@ -520,6 +521,7 @@ public:
|
||||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:kDisableUserCandidateSelectionLearning]) {
|
if (![[NSUserDefaults standardUserDefaults] boolForKey:kDisableUserCandidateSelectionLearning]) {
|
||||||
NSString *trigram = [self neighborTrigramString];
|
NSString *trigram = [self neighborTrigramString];
|
||||||
|
|
||||||
|
// Lookup from the user dict to see if the trigram fit or not
|
||||||
NSString *overrideCandidateString = [TLCandidateLearningDictionary objectForKey:trigram];
|
NSString *overrideCandidateString = [TLCandidateLearningDictionary objectForKey:trigram];
|
||||||
if (overrideCandidateString) {
|
if (overrideCandidateString) {
|
||||||
[self candidateSelected:(NSAttributedString *)overrideCandidateString];
|
[self candidateSelected:(NSAttributedString *)overrideCandidateString];
|
||||||
|
@ -537,6 +539,7 @@ public:
|
||||||
// keyCode 125 = Down, charCode 32 = Space
|
// keyCode 125 = Down, charCode 32 = Space
|
||||||
if (_bpmfReadingBuffer->isEmpty() && [_composingBuffer length] > 0 && (keyCode == downKey || charCode == 32)) {
|
if (_bpmfReadingBuffer->isEmpty() && [_composingBuffer length] > 0 && (keyCode == downKey || charCode == 32)) {
|
||||||
if (charCode == 32) {
|
if (charCode == 32) {
|
||||||
|
// if the spacebar is NOT set to be a selection key
|
||||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:kChooseCandidateUsingSpaceKey]) {
|
if (![[NSUserDefaults standardUserDefaults] boolForKey:kChooseCandidateUsingSpaceKey]) {
|
||||||
if (_builder->cursorIndex() >= _builder->length()) {
|
if (_builder->cursorIndex() >= _builder->length()) {
|
||||||
[_composingBuffer appendString:@" "];
|
[_composingBuffer appendString:@" "];
|
||||||
|
@ -572,6 +575,8 @@ public:
|
||||||
|
|
||||||
[self updateClientComposingBuffer:client];
|
[self updateClientComposingBuffer:client];
|
||||||
return YES;
|
return YES;
|
||||||
|
//可能的行為包括 1. 取消組字, 把字吃掉 2. 取消 candidate 選擇, 恢復原來的
|
||||||
|
//3. 取消組字,現出注音
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Right key, note we use keyCode here
|
// The Right key, note we use keyCode here
|
||||||
|
@ -1005,8 +1010,7 @@ void LTLoadLanguageModel()
|
||||||
|
|
||||||
NSString *appSupportPath = [paths objectAtIndex:0];
|
NSString *appSupportPath = [paths objectAtIndex:0];
|
||||||
|
|
||||||
// TODO: Change this
|
NSString *userDictPath = [appSupportPath stringByAppendingPathComponent:@"McBopomofo"];
|
||||||
NSString *userDictPath = [appSupportPath stringByAppendingPathComponent:@"Lettuce"];
|
|
||||||
|
|
||||||
BOOL isDir = NO;
|
BOOL isDir = NO;
|
||||||
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:userDictPath isDirectory:&isDir];
|
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:userDictPath isDirectory:&isDir];
|
||||||
|
|
Loading…
Reference in New Issue