Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #4 from hotwoofy/master

Dirty tracking and 'withTokens' API
  • Loading branch information...
commit 013a317c901460cd1af84f34e04fb985052fbc12 2 parents e42f27a + 78a962d
Samuel Mendes authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 src/BKClassifier.m
4 src/BKClassifier.m
@@ -277,7 +277,6 @@ - (void)trainWithString:(NSString*)trainString forPoolNamed:(NSString*)poolName
277 277 NSArray *tokens = [tokenizer tokenizeString:trainString];
278 278 BKDataPool *pool = [self poolNamed:poolName];
279 279 [self trainWithTokens:tokens inPool:pool];
280   - dirty = YES;
281 280 }
282 281
283 282 - (void)trainWithTokens:(NSArray*)tokens inPool:(BKDataPool*)pool
@@ -287,6 +286,7 @@ - (void)trainWithTokens:(NSArray*)tokens inPool:(BKDataPool*)pool
287 286 [pool increaseCountForToken:token];
288 287 [corpus increaseCountForToken:token];
289 288 }
  289 + dirty = YES;
290 290 }
291 291
292 292 #pragma mark -
@@ -307,12 +307,12 @@ - (NSDictionary*)guessWithFile:(NSString*)path
307 307 - (NSDictionary*)guessWithString:(NSString*)string
308 308 {
309 309 NSArray *tokens = [tokenizer tokenizeString:string];
310   - [self updatePoolsProbabilities];
311 310 return [self guessWithTokens:tokens];
312 311 }
313 312
314 313 - (NSDictionary*)guessWithTokens:(NSArray*)tokens
315 314 {
  315 + [self updatePoolsProbabilities];
316 316 NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:[pools count]];
317 317
318 318 for (NSString *poolName in pools) {

0 comments on commit 013a317

Please sign in to comment.
Something went wrong with that request. Please try again.