in lib/twitter_cldr/segmentation/suppressions.rb [49:76]
def should_break?(cursor)
idx = cursor.position
idx -= 2 if cursor.codepoint(idx - 1) == 32
node = backward_trie.root
found = loop do
break false if idx < 0 || idx >= cursor.length
node = node.child(cursor.codepoint(idx))
break false unless node
break true if node.value
idx -= 1
end
return true unless found
node = forward_trie.root
loop do
return true if idx >= cursor.length
node = node.child(cursor.codepoint(idx))
return true unless node
return false if node.value
idx += 1
end
end