Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base: e42f27a32a
...
compare: 013a317c90
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Oct 10, 2011
Thom Lawrence hotwoofy Change dirty-tracking to allow users to directly supply tokens. 78a962d
Commits on Nov 24, 2011
Samuel Mendes Merge pull request #4 from hotwoofy/master
Dirty tracking and 'withTokens' API
013a317
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/BKClassifier.m
4 src/BKClassifier.m
View
@@ -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) {

No commit comments for this range

Something went wrong with that request. Please try again.