Skip to content

Instantly share code, notes, and snippets.

@epugh
Created August 3, 2018 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epugh/836ff37fbf9f9d94b57d9142ade2388c to your computer and use it in GitHub Desktop.
Save epugh/836ff37fbf9f9d94b57d9142ade2388c to your computer and use it in GitHub Desktop.
Friday share messaging
classifier = ClassifierReborn::LSI.new #:auto_rebuild => false
strings = [
["n/a OSC Retreat.", :missing],
["LOOKING FOR SPEAKER", :missing],
["Need speaker", :missing],
["Elizabeth Solr Search", :present],
["Matt Datastax", :present],
["Scott Roll your own user analytics with Zeppelin", :present],
["Brandon Rose Spark and Elasticsearch", :present],
["Elizabeth Testing search relevance", :present],
["Eric Pugh, Bing Gin (SearchStax) SearchStax Briefing (Resheduled)", :present],
["Pere Rene Elizabeth Search engine comparison (30 mins Marklogic; 30 mins SQL Server Search Liz)", :present]
]
strings.each { |x| classifier.add_item x.first, x.last }
assert_same :missing, (classifier.classify ("speakers are needed"))
assert_same :missing, (classifier.classify ("speaker needed"))
assert_not_same :missing, (classifier.classify ("Matt Overstreet Solr Stemmers"))
assert_same :present, (classifier.classify ("Matt Overstreet Solr Stemmers"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment