Skip to content

etozzato/word-parser-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOLANG Word Parser (CGO/Rails/RUBY/FFI)

Compile the package

~/go/word-parser  go build -buildmode=c-shared -o word-parser.so word-parser.go

See the tree (postfix_sets)

~/go/word-parser  ruby ruby-test/tree.rb
response_ids: [819631, 723650, 783997, 872315, 668966, 669051, 886137, 668746, 668762, 956458, 872357, 859839, 966979, 668542, 668969, 751886, 953519, 723659, 762572, 913231, 720924, 722565, 722636, 957714, 721135, 648078, 665538, 720348, 876067, 751885, 864572, 882346, 881934, 865700, 868331, 660083, 714058, 751884]
postfix_sets: [{"ResponseID"=>819631, "Sentences"=>[[" the", " trend", " of", " iced", " coffee", "."], [" it", "."]]}, {"ResponseID"=>723650, "Sentences"=>[[" pecans", ",", " they", " are", " one", " of", " my", " favorite", " nuts", "."]]}, {"ResponseID"=>783997, "Sentences"=>[[" my", " coffee", "."]]}, {"ResponseID"=>872315, "Sentences"=>[[" hamburgers!"]]}, {"ResponseID"=>668966, "Sentences"=>[[" computers", " 2", "."], [" my", " girlfriend", " 3", "."], [" food", "."]]}, {"ResponseID"=>669051, "Sentences"=>[[" the", " idea", " of", " free", " range", " chicken!"]]}, {"ResponseID"=>886137, "Sentences"=>[[" avocado", "."], [" avocado", ",", " but", " I", " really", " love", " the", " guacamole", "."]]}, {"ResponseID"=>668746, "Sentences"=>[[" the", " outdoors", ",", " rock", " climbing", ",", " and", " traveling!"]]}, {"ResponseID"=>668762, "Sentences"=>[[" your", " employees", ",", " who", " are", " always", " very", " helpful", " and", " friendly", "."]]}, {"ResponseID"=>956458, "Sentences"=>[[" my", " crunch", " berries!"]]}, {"ResponseID"=>872357, "Sentences"=>[[" fall", " and", " anything", " pumpkin", " related", "."]]}, {"ResponseID"=>859839, "Sentences"=>[[" coke", " zero", " too!"]]}, {"ResponseID"=>966979, "Sentences"=>[[" granola", " not", " yogurt", "."]]}, {"ResponseID"=>668542, "Sentences"=>[[" carrot", " juice", "."]]}, {"ResponseID"=>668969, "Sentences"=>[[" you", " because", " you", " always", " have", " everything", " I", " need", "."]]}, {"ResponseID"=>751886, "Sentences"=>[[" to", " play", " ice", " hockey", " and", " when", " I", " am", " not", " working", " I", " am", " playing", "."]]}, {"ResponseID"=>953519, "Sentences"=>[[" pancakes", "."]]}, {"ResponseID"=>723659, "Sentences"=>[[" breakfast", " pizzas", " and", " would", " like", " to", " try", " this", " sometime", "."]]}, {"ResponseID"=>762572, "Sentences"=>[[" danish", " and", " this", " was", " at", " a", " conference", " where", " I", " was", "."]]}, {"ResponseID"=>913231, "Sentences"=>[[" this!"]]}, {"ResponseID"=>720924, "Sentences"=>[[" these!"]]}, {"ResponseID"=>722565, "Sentences"=>[[" anything", " on", " a", " bed", " of", " spinach!"]]}, {"ResponseID"=>722636, "Sentences"=>[[" choc", " and", " peanut", " butter", "."]]}, {"ResponseID"=>957714, "Sentences"=>[[" it's", " color!"]]}, {"ResponseID"=>721135, "Sentences"=>[[" red", " velvet", "."]]}, {"ResponseID"=>648078, "Sentences"=>[[" the", " gluten", " free", " trend!"]]}, {"ResponseID"=>665538, "Sentences"=>[[" it", "."]]}, {"ResponseID"=>720348, "Sentences"=>[[" that", " you", " are", " convenient", ",", " less", " than", " 2", " miles", " down", " the", " road", " from", " me", " and", " right", " off", " the", " highway", " for", " others", " in", " town", "."], [" that", " you", " have", " provided", " me", " with", " a", " scanner", " card", " and", " give", " my", " points", " for", " my", " grocery", " purchase", " that", " I", " can", " then", " redeem", " for", " 10", " cents/", " 20", " cents/", " even", " 30", " cents", " off", " of", " gas", " at", " certain", " gas", " stations", "."], [" your", " staff", " at", " my", " local", " stop", " and", " shop", ",", " especially", " Bud", " who", " collects", " the", " carts", ",", " he", " is", " extremely", " friendly", " and", " I", " look", " forward", " to", " seeing", " him", " when", " I", " am", " there", "."], [" you", " stop", " and", " shop!"]]}, {"ResponseID"=>876067, "Sentences"=>[[" bottled", " water", "."]]}, {"ResponseID"=>751885, "Sentences"=>[[" this", " stuff", " and", " really", " like", " that", " it", " is", " calorie", " free", "."]]}, {"ResponseID"=>864572, "Sentences"=>[[" spicy", " wheat", " thins!"]]}, {"ResponseID"=>882346, "Sentences"=>[[" all", " cheeses", "."]]}, {"ResponseID"=>881934, "Sentences"=>[[" the", " new", " flavors", " of", " bread!"], [" the", " gingerbread", " even", " more!"]]}, {"ResponseID"=>865700, "Sentences"=>[[" buttercream", " frosting!"]]}, {"ResponseID"=>868331, "Sentences"=>[[" wheat", " thins", "."]]}, {"ResponseID"=>660083, "Sentences"=>[[" tea", "."]]}, {"ResponseID"=>714058, "Sentences"=>[[" to", " add", " a", " teaspoon", " of", " buffalo", " sauce", " and", " a", " side", " of", " spinach", " and", " sliced", " strawberries", "."]]}, {"ResponseID"=>751884, "Sentences"=>[[" to", " do", " year", " round", " but", " most", " especially", " in", " the", " summer", " is", " play", " golf", "."], [" being", " outside", ",", " I", " love", " playing", " the", " game", " of", " golf", ",", " and", " I", " love", " the", " feeling", " I", " get", " at", " the", " end", " of", " a", " great", " round", "."]]}]

See the cloud

~/go/word-parser  ruby ruby-test/cloud.rb
heaviest_word: love
word_cloud: [{"Text"=>"love", "Weight"=>67}, {"Text"=>"food", "Weight"=>28}, {"Text"=>"coke", "Weight"=>27}, {"Text"=>"coffee", "Weight"=>26}, {"Text"=>"looks", "Weight"=>26}, {"Text"=>"really", "Weight"=>24}, {"Text"=>"eat", "Weight"=>24}, {"Text"=>"healthy", "Weight"=>21}, {"Text"=>"think", "Weight"=>18}, {"Text"=>"water", "Weight"=>18}, {"Text"=>"stores", "Weight"=>17}, {"Text"=>"items", "Weight"=>16}, {"Text"=>"favorite", "Weight"=>15}, {"Text"=>"free", "Weight"=>14}, {"Text"=>"tea", "Weight"=>14}, {"Text"=>"chicken", "Weight"=>13}, {"Text"=>"lunch", "Weight"=>13}, {"Text"=>"salad", "Weight"=>13}, {"Text"=>"store", "Weight"=>12}, {"Text"=>"breakfast", "Weight"=>12}, {"Text"=>"diet", "Weight"=>12}, {"Text"=>"organic", "Weight"=>11}, {"Text"=>"gluten", "Weight"=>11}, {"Text"=>"cheese", "Weight"=>11}, {"Text"=>"juice", "Weight"=>11}, {"Text"=>"pepsi", "Weight"=>11}, {"Text"=>"yummy", "Weight"=>11}, {"Text"=>"grocery", "Weight"=>11}, {"Text"=>"morning", "Weight"=>11}, {"Text"=>"eating", "Weight"=>11}, {"Text"=>"feel", "Weight"=>11}, {"Text"=>"lot", "Weight"=>11}, {"Text"=>"foods", "Weight"=>11}, {"Text"=>"sandwich", "Weight"=>10}, {"Text"=>"spinach", "Weight"=>10}, {"Text"=>"2", "Weight"=>10}, {"Text"=>"shop", "Weight"=>10}, {"Text"=>"drink", "Weight"=>9}, {"Text"=>"3", "Weight"=>9}, {"Text"=>"expensive", "Weight"=>9}, {"Text"=>"taste", "Weight"=>9}, {"Text"=>"whole", "Weight"=>9}, {"Text"=>"things", "Weight"=>8}, {"Text"=>"zero", "Weight"=>8}, {"Text"=>"produce", "Weight"=>8}, {"Text"=>"delicious", "Weight"=>8}, {"Text"=>"donuts", "Weight"=>8}, {"Text"=>"better", "Weight"=>8}, {"Text"=>"fruit", "Weight"=>8}, {"Text"=>"wheat", "Weight"=>8}]

About

a simple golang experiment with ruby, cgo and ffi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published