Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4 from hotwoofy/master

Dirty tracking and 'withTokens' API
  • Loading branch information...
commit 013a317c901460cd1af84f34e04fb985052fbc12 2 parents e42f27a + 78a962d
@lok 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.