Skip to content

Instantly share code, notes, and snippets.

@koseki
Last active June 16, 2023 06:55
Show Gist options
  • Save koseki/e19d6cb15c403b320fbf4ed557606c3c to your computer and use it in GitHub Desktop.
Save koseki/e19d6cb15c403b320fbf4ed557606c3c to your computer and use it in GitHub Desktop.
WordNet 3.0 + Ruby (rwordnet)
source 'https://rubygems.org'
gem 'rwordnet'
# $ bundle exec ruby ./bin/wordnet.rb | sort | uniq | wc -l
# 147307
#
# $ bundle exec ruby ./bin/wordnet.rb show
### Lemma (show,n) ================================================================
## Synset ----------------------------------------------------------------
["show"]
the act of publicly exhibiting or entertaining; "a remarkable show of skill"
==> Hypernyms
["entertainment", "amusement"]
an activity that is diverting and that holds the attention
==> Hyponyms
["carnival", "fair", "funfair"]
a traveling show; having sideshows and rides and games of skill etc.
["dog_show"]
a competitive exhibition of dogs
["horseshow"]
a competitive exhibition of horses
["raree-show"]
a street show
["circus"]
a performance given by a traveling company of acrobats, clowns, and trained animals; "the children always love to go to the circus"
["cabaret", "floorshow", "floor_show"]
a series of acts at a night club
["ice_show"]
any entertainment performed by ice skaters
["interlude", "intermezzo", "entr'acte"]
a brief show (music or dance etc) inserted between the sections of a longer performance
["display", "exhibit", "showing"]
something shown to the public; "the museum had many exhibits of oriental art"
["presentation", "presentment", "demonstration"]
a show or display; the act of presenting something to sight or view; "the presentation of new data"; "he gave the customer a demonstration"
["demonstration"]
a show of military force or preparedness; "he confused the enemy with feints and demonstrations"
["road_show"]
a show on tour
["sideshow"]
a minor show that is part of a larger one (as at the circus)
["Wild_West_Show", "Buffalo_Bill's_Wild_West_Show"]
a spectacular show organized in 1883 by William F. Cody that featured horseback riding and marksmanship on a large scale; toured the United States and Europe
==> Antonyms
## Synset ----------------------------------------------------------------
["display", "show"]
something intended to communicate a particular impression; "made a display of strength"; "a show of impatience"; "a good show of looking interested"
==> Hypernyms
["demonstration", "demo"]
a visual presentation showing how something works; "the lecture was accompanied by dramatic demonstrations"; "the lecturer shot off a pistol as a demonstration of the startle response"
==> Hyponyms
["big_stick"]
a display of force or power; "speak softly but carry a big stick"
["gaudery", "pomp"]
cheap or pretentious or vain display
==> Antonyms
## Synset ----------------------------------------------------------------
["show"]
a social event involving a public performance or entertainment; "they wanted to see some of the shows on Broadway"
==> Hypernyms
["social_event"]
an event characteristic of persons forming groups
==> Hyponyms
["stage_dancing", "choreography"]
a show involving artistic dancing
[]
a form of entertainment that enacts a story by sound and a sequence of images giving the illusion of continuous movement; "they went to a movie every Saturday night"; "the film was shot on location"
["attraction"]
an entertainment that is offered to the public
["broadcast", "program", "programme"]
a radio or television show; "did you see his program last night?"
["performance", "public_presentation"]
a dramatic or musical entertainment; "they listened to ten different performances"; "the play ran for 100 performances"; "the frequent performances of the symphony testify to its popularity"
["burlesque"]
a theatrical entertainment of broad and earthy humor; consists of comic skits and short turns (and sometimes striptease)
["play"]
a theatrical performance of a drama; "the play lasted two hours"
["galanty_show", "shadow_show", "shadow_play"]
a drama executed by throwing shadows on a wall
["puppet_show", "puppet_play"]
a show in which the actors are puppets
["variety_show", "variety"]
a show consisting of a series of short unrelated performances
==> Antonyms
## Synset ----------------------------------------------------------------
["appearance", "show"]
pretending that something is the case in order to make a good impression; "they try to keep up appearances"; "that ceremony is just for show"
==> Hypernyms
["pretense", "pretence", "pretending", "simulation", "feigning"]
the act of giving a false appearance; "his conformity was only pretending"
==> Hyponyms
==> Antonyms
### Lemma (show,v) ================================================================
## Synset ----------------------------------------------------------------
["show", "demo", "exhibit", "present", "demonstrate"]
give an exhibition of to an interested audience; "She shows her dogs frequently"; "We will demo the new software in Washington"
==> Hypernyms
["show"]
make visible or noticeable; "She showed her talent for cooking"; "Show me your etchings, please"
==> Hyponyms
["bring_home"]
make understandable and clear; "This brings home my point"
==> Antonyms
## Synset ----------------------------------------------------------------
["prove", "demonstrate", "establish", "show", "shew"]
establish the validity of something, as by an example, explanation or experiment; "The experiment demonstrated the instability of the compound"; "The mathematician showed the validity of the conjecture"
==> Hypernyms
["confirm", "corroborate", "sustain", "substantiate", "support", "affirm"]
establish or strengthen as with new evidence or facts; "his story confirmed my doubts"; "The evidence supports the defendant"
==> Hyponyms
["prove_oneself"]
show one's ability or courage
["prove"]
prove formally; demonstrate by a mathematical, formal proof
["negate", "contradict"]
prove negative; show to be false
["stultify"]
prove to be of unsound mind or demonstrate someone's incompetence; "nobody is legally allowed to stultify himself"
==> Antonyms
["disprove", "confute"]
prove to be false; "The physicist disproved his colleagues' theories"
## Synset ----------------------------------------------------------------
["testify", "bear_witness", "prove", "evidence", "show"]
provide evidence for; "The blood test showed that he was the father"; "Her behavior testified to her incompetence"
==> Hypernyms
["inform"]
impart knowledge of some fact, state or affairs, or event to; "I informed him of his rights"
==> Hyponyms
["attest", "certify", "manifest", "demonstrate", "evidence"]
provide evidence for; stand as proof of; show by one's behavior, attitude, or external attributes; "His high fever attested to his illness"; "The buildings in Rome manifest a high level of architectural sophistication"; "This decision demonstrates his sense of fairness"
["presume"]
constitute reasonable evidence for; "A restaurant bill presumes the consumption of food"
["adduce", "abduce", "cite"]
advance evidence for
==> Antonyms
## Synset ----------------------------------------------------------------
["show"]
make visible or noticeable; "She showed her talent for cooking"; "Show me your etchings, please"
==> Hypernyms
==> Hyponyms
["give"]
present to view; "He gave the sign to start"
["reflect"]
show an image of; "her sunglasses reflected his image"
["peep"]
cause to appear; "he peeped his head through the window"
["project"]
project on a screen; "The images are projected onto the screen"
["do_justice"]
bring out fully or to advantage; "This photograph does not do her justice"
["flash"]
expose or show briefly; "he flashed a $100 bill"
["screen"]
project onto a screen for viewing; "screen a film"
["expose", "exhibit", "display"]
to show, make visible or apparent; "The Metropolitan Museum is exhibiting Goya's works this month"; "Why don't you show your nice legs and wear shorter skirts?"; "National leaders will have to display the highest skills of statesmanship"
["fly"]
display in the air or cause to float; "fly a kite"; "All nations fly their flags in front of the U.N."
["uncover", "bring_out", "unveil", "reveal"]
make visible; "Summer brings out bright clothes"; "He brings out the best in her"
["show", "demo", "exhibit", "present", "demonstrate"]
give an exhibition of to an interested audience; "She shows her dogs frequently"; "We will demo the new software in Washington"
["etch"]
cause to stand out or be clearly defined or visible; "a face etched with pain"; "the leafless branches etched against the sky"
["define", "delineate"]
show the form or outline of; "The tree was clearly defined by the light"; "The camera could define the smallest object"
==> Antonyms
["hide", "conceal"]
prevent from being seen or discovered; "Muslim women hide their faces"; "hide the money"
## Synset ----------------------------------------------------------------
["picture", "depict", "render", "show"]
show in, or as in, a picture; "This scene depicts country life"; "the face of the child is rendered with much tenderness in this painting"
==> Hypernyms
["represent", "interpret"]
create an image or likeness of; "The painter represented his wife as a young girl"
==> Hyponyms
["illustrate"]
depict with an illustration
["map"]
depict as if on a map; "sorrow was mapped on the mother's face"
==> Antonyms
## Synset ----------------------------------------------------------------
["express", "show", "evince"]
give expression to; "She showed her disappointment"
==> Hypernyms
["convey"]
make known; pass on, of information; "She conveyed the message to me"
==> Hyponyms
["sneer"]
express through a scornful smile; "she sneered her contempt"
["imply", "connote"]
express or state indirectly
["burst_out"]
give sudden release to an expression; "We burst out laughing"; "'I hate you,' she burst out"
["suggest", "evoke", "paint_a_picture"]
call to mind; "this remark evoked sadness"
["imply"]
suggest as a logically necessary consequence; in logic
["give"]
manifest or show; "This student gives promise of real creativity"; "The office gave evidence of tampering"
["exude"]
make apparent by one's mood or behavior; "She exudes great confidence"
["vent", "ventilate", "give_vent"]
give expression or utterance to; "She vented her anger"; "The graduates gave vent to cheers"
["give_voice", "formulate", "word", "phrase", "articulate"]
put into words or an expression; "He formulated his concerns to the board of trustees"
["stress", "emphasize", "emphasise", "punctuate", "accent", "accentuate"]
to stress, single out as important; "Dr. Jones emphasizes exercise in addition to a change in diet"
["menace"]
express a threat either by an utterance or a gesture; "he menaced the bank manager with a stick"
["beam"]
express with a beaming face or smile; "he beamed his approval"
["smile"]
express with a smile; "She smiled her thanks"
==> Antonyms
## Synset ----------------------------------------------------------------
["indicate", "point", "designate", "show"]
indicate a place, direction, person, or thing; either spatially or figuratively; "I showed the customer the glove section"; "He pointed to the empty parking space"; "he indicated his opponents"
==> Hypernyms
["inform"]
impart knowledge of some fact, state or affairs, or event to; "I informed him of his rights"
==> Hyponyms
["point"]
indicate the presence of (game) by standing and pointing with the muzzle; "the dog pointed the dead duck"
["finger"]
indicate the fingering for the playing of musical scores for keyboard instruments
["signalize", "signalise", "point_out", "call_attention"]
point out carefully and clearly
["reflect"]
manifest or bring back; "This action reflects his true beliefs"
==> Antonyms
## Synset ----------------------------------------------------------------
["show", "show_up"]
be or become visible or noticeable; "His good upbringing really shows"; "The dirty side will show"
==> Hypernyms
["appear"]
come into sight or view; "He suddenly appeared at the wedding"; "A new star appeared on the horizon"
==> Hyponyms
["register"]
show in one's face; "Her surprise did not register"
==> Antonyms
## Synset ----------------------------------------------------------------
["read", "register", "show", "record"]
indicate a certain reading; of gauges and instruments; "The thermometer showed thirteen degrees below zero"; "The gauge read `empty'"
==> Hypernyms
["indicate"]
to state or express briefly; "indicated his wishes in a letter"
==> Hyponyms
["say"]
indicate; "The clock says noon"
["show"]
give evidence of, as of records; "The diary shows his distress that evening"
["strike"]
indicate (a certain time) by striking; "The clock struck midnight"; "Just when I entered, the clock struck"
==> Antonyms
## Synset ----------------------------------------------------------------
["show"]
give evidence of, as of records; "The diary shows his distress that evening"
==> Hypernyms
["read", "register", "show", "record"]
indicate a certain reading; of gauges and instruments; "The thermometer showed thirteen degrees below zero"; "The gauge read `empty'"
==> Hyponyms
["attest"]
establish or verify the usage of; "This word is not attested until 1993"
["surcharge"]
show an omission in (an account) for which credit ought to have been given
==> Antonyms
## Synset ----------------------------------------------------------------
["usher", "show"]
take (someone) to their seats, as in theaters or auditoriums; "The usher showed us to our seats"
==> Hypernyms
["lead", "take", "direct", "conduct", "guide"]
take somebody somewhere; "We lead him to our chief"; "can you take me to the main entrance?"; "He conducted us to the palace"
==> Hyponyms
["marshal"]
lead ceremoniously, as in a procession
==> Antonyms
## Synset ----------------------------------------------------------------
["show"]
finish third or better in a horse or dog race; "he bet $2 on number six to show"
==> Hypernyms
["race", "run"]
compete in a race; "he is running the Marathon this year"; "let's race and see who gets there first"
==> Hyponyms
==> Antonyms
#! /usr/local/env ruby
require 'wordnet'
module WordNet
class Lemma
class << self
def all
lemmas = {}
[:noun, :verb, :adj, :adv].each do |pos|
lemmas[pos] = build_cache(pos)
end
lemmas
end
end
end
end
if ARGV[0].nil?
# dump all words
lemmas = WordNet::Lemma.all
[:noun, :verb, :adj, :adv].each do |pos|
puts lemmas[pos].keys.join("\n")
end
else
lemmas = WordNet::Lemma::find_all(ARGV[0])
abort "not found" if lemmas.empty?
lemmas.each do |lemma|
puts
puts "### Lemma (#{lemma}) ================================================================"
puts
lemma.synsets.each do |syn|
puts
puts "## Synset ----------------------------------------------------------------"
puts
p syn.words
puts syn.gloss
puts
puts " ==> Hypernyms"
syn.hypernyms.each do |rel|
print ' '
p rel.words
print ' '
puts rel.gloss
end
puts
puts " ==> Hyponyms"
syn.hyponyms.each do |rel|
print ' '
p rel.words
print ' '
puts rel.gloss
end
puts
puts " ==> Antonyms"
syn.antonyms.each do |rel|
print ' '
p rel.words
print ' '
puts rel.gloss
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment