Skip to content

Commit

Permalink
Allow biasing for longer token streams by ignoring endtokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ketralnis committed Feb 8, 2010
1 parent 6d4373a commit dffdd01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion memcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# next follower. This list defines how heavily
chain_weights = range(1, chain_length+1)

# whether to append EndTokens to the end of token streams. Not doing
# so biases for longer comments
endtokens = False

class Cache(Client):
def __init__(self, iden):
Client.__init__(self, iden.split(','))
Expand Down Expand Up @@ -77,7 +81,7 @@ def tokenize(cls, text, beginend = True):
tok = cls(x)
if tok.kind != 'whitespace':
yield tok
if beginend:
if beginend and endtokens:
yield EndToken()

def __repr__(self):
Expand Down

0 comments on commit dffdd01

Please sign in to comment.