Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. require 'tactful_tokenizer'
  2. require 'treat'
  3. require 'pry'
  4. require_relative 'lib/extensions/String'
  5.  
  6. include Treat::Core::DSL # Gives quick access to named entity
  7. tt = TactfulTokenizer::Model.new # Creates an instance of the tokenizer
  8.  
  9.  
  10. keywordRegexes = [/death/,
  11. /died/,
  12. /passed s+ away/xm,]
  13.  
  14.  
  15. #Open example documents
  16.  
  17. Dir.glob('examples/*.txt'). each do |filename|
  18. testdocument = File.open(filename).read
  19.  
  20.  
  21. testdocument.gsub!(/[nr]/," ")
  22. testdocument.squeeze!(" ")
  23.  
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement