Skip to content

Commit

Permalink
Ooops, slight mistake on the contraction handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Harris committed Aug 18, 2013
1 parent b190084 commit 3b5507a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion markov.rb
Expand Up @@ -58,7 +58,7 @@ def add_sentence_internal(str, terminator)
CONTRACTIONS.each do |c|
str.gsub!(/#{c}/i) {|m| m.gsub("'", CONTRACTION_APOSTROPHE_SUBSTITUTE)}
end
str.gsub!(/'s/, CONTRACTION_APOSTROPHE_SUBSTITUTE)
str.gsub!(/'s/, "#{CONTRACTION_APOSTROPHE_SUBSTITUTE}s")

#puts str
words = str.scan(/[\p{Word}'’\-]+/)
Expand Down

0 comments on commit 3b5507a

Please sign in to comment.