Skip to content

Commit

Permalink
Refactor for speed
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed Aug 18, 2014
1 parent b3ee522 commit 94d396e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/llt/tokenizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,16 @@ def enclitic(val)
/^(οὐ|μή)δε$/i => 'δε',
}
def split_frequent_enclitics
ENCLITICS_MAP.each do |regex, encl|
container = []
@worker.each_with_index do |token, i|
container = []
@worker.each_with_index do |token, i|
ENCLITICS_MAP.each do |regex, encl|
if token.match(regex)
token.slice!(-encl.length, encl.length)
container << (i + container.size + @shift_range)
container << [encl, (i + container.size + @shift_range)]
end
end
container.each { |i| @worker.insert(i, enclitic(encl)) }
end
container.each { |encl, i|@worker.insert(i, enclitic(encl)) }
end

def make_frequent_corrections
Expand Down

0 comments on commit 94d396e

Please sign in to comment.