Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change dirty-tracking to allow users to directly supply tokens.

  • Loading branch information...
commit 78a962db8d742cf4787d819e509410b2534c300d 1 parent e42f27a
@hotwoofy authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/BKClassifier.m
View
4 src/BKClassifier.m
@@ -277,7 +277,6 @@ - (void)trainWithString:(NSString*)trainString forPoolNamed:(NSString*)poolName
NSArray *tokens = [tokenizer tokenizeString:trainString];
BKDataPool *pool = [self poolNamed:poolName];
[self trainWithTokens:tokens inPool:pool];
- dirty = YES;
}
- (void)trainWithTokens:(NSArray*)tokens inPool:(BKDataPool*)pool
@@ -287,6 +286,7 @@ - (void)trainWithTokens:(NSArray*)tokens inPool:(BKDataPool*)pool
[pool increaseCountForToken:token];
[corpus increaseCountForToken:token];
}
+ dirty = YES;
}
#pragma mark -
@@ -307,12 +307,12 @@ - (NSDictionary*)guessWithFile:(NSString*)path
- (NSDictionary*)guessWithString:(NSString*)string
{
NSArray *tokens = [tokenizer tokenizeString:string];
- [self updatePoolsProbabilities];
return [self guessWithTokens:tokens];
}
- (NSDictionary*)guessWithTokens:(NSArray*)tokens
{
+ [self updatePoolsProbabilities];
NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:[pools count]];
for (NSString *poolName in pools) {
Please sign in to comment.
Something went wrong with that request. Please try again.