Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::WordNetOntology Class Reference

#include <WordNetOntology.h>

Collaboration diagram for PLearn::WordNetOntology:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WordNetOntology ()
 WordNetOntology (string voc_file, bool differentiate_unknown_words, bool pre_compute_ancestors, bool pre_compute_descendants, int wn_pos_type=ALL_WN_TYPE, int word_coverage_threshold=-1)
 WordNetOntology (string voc_file, string synset_file, string ontology_file, bool pre_compute_ancestors, bool pre_compute_descendants, int word_coverage_threshold=-1)
 WordNetOntology (string voc_file, string synset_file, string ontology_file, string sense_key_file, bool pre_compute_ancestors, bool pre_compute_descendants, int word_coverage_threshold=-1)
void save (string synset_file, string ontology_file)
void save (string voc_file)
void saveVocInWordnet (string voc_file)
void save (string synset_file, string ontology_file, string sense_key_file)
void load (string voc_file, string synset_file, string ontology_file)
void load (string voc_file, string synset_file, string ontology_file, string sense_key_file)
void savePredominentSyntacticClasses (string file)
void loadPredominentSyntacticClasses (string file)
string getSenseKey (int word_id, int ss_id)
int getSynsetIDForSenseKey (int word_id, string sense_key)
int getWordId (string word)
string getWord (int id)
int getWordSenseIdForWnsn (string word, int wn_pos_type, int wnsn)
int getWordSenseIdForSenseKey (string lemma, string lexsn, string word)
int getWordSenseUniqueId (int word, int sense)
int getWordSenseUniqueIdSize ()
Set getWordSenses (int id)
Set getWordHighLevelSenses (int id)
Set getWordNounSenses (int id)
Set getWordVerbSenses (int id)
Set getWordAdjSenses (int id)
Set getWordAdvSenses (int id)
Set getWordsForSense (int id)
Set getSynsetAncestors (int id, int max_level=-1)
Set getSynsetParents (int id)
Set getWordAncestors (int id, int max_level=-1)
Set getSynsetSenseDescendants (int id)
Set getSynsetWordDescendants (int id)
NodegetSynset (int id)
NodegetRootSynset ()
Set getAllWords ()
Set getAllSenses ()
Set getAllCategories ()
int getVocSize ()
int getSenseSize ()
int getSynsetSize ()
int getMaxSynsetId ()
Set getSyntacticClassesForWord (int word_id)
int getSyntacticClassForSense (int sense_id)
int getPredominentSyntacticClassForWord (int word_id)
void getDescendantCategoriesAtLevel (int ss_id, int cur_level, int target_level, Set categories)
void getDownToUpParentCategoriesAtLevel (int ss_id, int target_level, Set categories, int cur_level=0)
bool isWord (int id)
bool isWord (string word)
bool isSense (int id)
bool isPureSense (int id)
bool isCategory (int id)
bool isPureCategory (int id)
bool isSynset (int id)
bool isWordUnknown (string word)
bool isWordUnknown (int id)
bool isSynsetUnknown (int id)
bool isInWordNet (string word, bool trim_word=true, bool stem_word=true, bool remove_undescores=false)
bool isInWordNet (int word_id)
bool hasSenseInWordNet (string word, int wn_pos_type)
bool isTopLevelCategory (int ss_id)
bool containsWord (string word)
bool containsWordId (int id)
NodefindSynsetFromSynsAndGloss (const vector< string > &syns, const string &gloss, const long offset, const int fnum)
void removeNonReachableSynsets ()
void removeWord (int id)
void print (bool print_ontology=true)
void printSynset (int ss_id, int indent_level=0)
void printSynset (int ss_id, ostream &sout, int indent_level=0)
void printStats ()
void printSynsetAncestors ()
void printWordAncestors ()
void printDescendants ()
void printNodes ()
void printWordOntology (int id)
void printWordOntology (string word)
void printInvertedSynsetOntology (int id, int level=0)
int overlappingSynsets (int ss_id1, int ss_id2)
bool areOverlappingSynsets (int ss_id1, int ss_id2)
void intersectAncestorsAndSenses (Set categories, Set senses)
void reducePolysemy (int level)
void extractPredominentSyntacticClasses ()
void extractWordHighLevelSenses (int noun_depth, int verb_depth, int adj_depth, int adv_depth, int unk_depth)
void extractWordNounAndVerbHighLevelSenses (int noun_depth, int verb_depth)
void detectWordsWithoutOntology ()
void lookForSpecialTags ()
void extract (string voc_file, int wn_pos_type)
void extractWord (string original_word, int wn_pos_type, bool trim_word, bool stem_word, bool remove_underscores)
bool extractSenses (string original_word, string processed_word, int wn_pos_type)
void extractTaggedWordFrequencies (map< int, map< int, int > > &word_senses_to_tagged_frequencies)
NodeextractOntology (SynsetPtr ssp)
void extractAncestors (int threshold, bool cut_with_word_coverage, bool exclude_itself)
void extractAncestors (Node *node, Set ancestors, int level, int level_threshold)
void extractAncestors (Node *node, Set ancestors, int word_coverage_threshold)
void extractDescendants (Node *node, Set sense_descendants, Set word_descendants)
void extractStrictDescendants (Node *node, Set sense_descendants, Set word_descendants)
void extractDescendants ()
void computeWordSenseUniqueIds ()
void init (bool differentiate_unknown_words=true)
void createBaseSynsets ()
void processUnknownWord (int word_id)
void finalize ()
void propagatePOSTypes ()
void propagatePOSTypes (Node *node)
void linkUpperCategories ()
NodecheckForAlreadyExtractedSynset (SynsetPtr ssp)
vector< stringgetSynsetWords (SynsetPtr ssp)
bool catchSpecialTags (string word)
void reduceWordPolysemy (int word_id, int level)
void reduceWordPolysemy_preserveSenseOverlapping (int word_id, int level)
void reduceWordPolysemy_preserveSenseOverlapping2 (int word_id, int level)
void getCategoriesAtLevel (int ss_id, int cur_level, int target_level, set< int > &categories)
void getCategoriesUnderLevel (int ss_id, int cur_level, int target_level, Set categories)
void visitUpward (Node *node)
void unvisitDownward (Node *node)
void unvisitAll ()
void printOntology (Node *node, int level=0)
void fillTempWordToSensesTVecMap ()
TVec< intgetSensesForWord (int w)
void fillTempWordToHighLevelSensesTVecMap ()
TVec< intgetHighLevelSensesForWord (int w)
TVec< intgetSecondLevelSensesForWord (int w)
TVec< intgetThirdLevelSensesForWord (int w)

Public Attributes

map< int, TVec< int > > temp_word_to_senses
map< int, TVec< int > > temp_word_to_noun_senses
map< int, TVec< int > > temp_word_to_verb_senses
map< int, TVec< int > > temp_word_to_adj_senses
map< int, TVec< int > > temp_word_to_adv_senses
map< int, TVec< int > > temp_word_to_high_level_senses

Protected Attributes

map< int, Setword_to_senses
map< int, Setword_to_noun_senses
map< int, Setword_to_verb_senses
map< int, Setword_to_adj_senses
map< int, Setword_to_adv_senses
map< int, Setsense_to_words
map< int, Setsynset_to_ancestors
map< int, Setword_to_ancestors
map< int, Setsynset_to_sense_descendants
map< int, Setsynset_to_word_descendants
map< int, Node * > synsets
map< int, stringwords
map< string, intwords_id
map< int, vector< int > > word_to_noun_wnsn
map< int, vector< int > > word_to_verb_wnsn
map< int, vector< int > > word_to_adj_wnsn
map< int, vector< int > > word_to_adv_wnsn
map< int, intword_to_predominent_pos
map< int, boolword_is_in_wn
map< int, Setword_to_high_level_senses
map< pair< int, int >, intword_sense_to_unique_id
map< int, Setword_to_under_target_level_high_level_senses
map< pair< int, string >,
int
sense_key_to_ss_id
map< pair< int, int >, stringws_id_to_sense_key
int word_index
int synset_index
int unknown_sense_index
int noun_count
int verb_count
int adj_count
int adv_count
int noun_sense_count
int verb_sense_count
int adj_sense_count
int adv_sense_count
int in_wn_word_count
int out_of_wn_word_count
bool are_ancestors_extracted
bool are_descendants_extracted
bool are_predominent_pos_extracted
bool are_word_high_level_senses_extracted
bool are_word_sense_unique_ids_computed
int n_word_high_level_senses
bool differentiate_unknown_words

Constructor & Destructor Documentation

PLearn::WordNetOntology::WordNetOntology  ) 
 

Definition at line 51 of file WordNetOntology.cc.

References createBaseSynsets(), and init().

PLearn::WordNetOntology::WordNetOntology string  voc_file,
bool  differentiate_unknown_words,
bool  pre_compute_ancestors,
bool  pre_compute_descendants,
int  wn_pos_type = ALL_WN_TYPE,
int  word_coverage_threshold = -1
 

Definition at line 57 of file WordNetOntology.cc.

References createBaseSynsets(), extract(), extractAncestors(), extractDescendants(), and init().

PLearn::WordNetOntology::WordNetOntology string  voc_file,
string  synset_file,
string  ontology_file,
bool  pre_compute_ancestors,
bool  pre_compute_descendants,
int  word_coverage_threshold = -1
 

Definition at line 73 of file WordNetOntology.cc.

References extractAncestors(), extractDescendants(), init(), and PLearn::load().

PLearn::WordNetOntology::WordNetOntology string  voc_file,
string  synset_file,
string  ontology_file,
string  sense_key_file,
bool  pre_compute_ancestors,
bool  pre_compute_descendants,
int  word_coverage_threshold = -1
 

Definition at line 89 of file WordNetOntology.cc.

References extractAncestors(), extractDescendants(), init(), and PLearn::load().


Member Function Documentation

bool PLearn::WordNetOntology::areOverlappingSynsets int  ss_id1,
int  ss_id2
[inline]
 

Definition at line 333 of file WordNetOntology.h.

References areOverlappingSynsets().

Referenced by areOverlappingSynsets().

bool PLearn::WordNetOntology::catchSpecialTags string  word  ) 
 

Definition at line 763 of file WordNetOntology.cc.

References BOS_SS_ID, BOS_TAG, EOS_SS_ID, EOS_TAG, NUMERIC_SS_ID, NUMERIC_TAG, OOV_SS_ID, OOV_TAG, PROPER_NOUN_SS_ID, PROPER_NOUN_TAG, PUNCTUATION_SS_ID, PUNCTUATION_TAG, sense_to_words, STOP_SS_ID, STOP_TAG, word_to_senses, and words_id.

Referenced by extractWord().

Node * PLearn::WordNetOntology::checkForAlreadyExtractedSynset SynsetPtr  ssp  ) 
 

Definition at line 1038 of file WordNetOntology.cc.

References PLearn::Node::fnum, getSynsetWords(), PLearn::Node::gloss, PLearn::Node::hereiam, PLearn::Node::syns, and synsets.

Referenced by extractOntology(), and extractSenses().

void PLearn::WordNetOntology::computeWordSenseUniqueIds  ) 
 

Definition at line 2763 of file WordNetOntology.cc.

References are_word_sense_unique_ids_computed, PLearn::Set::begin(), PLearn::Set::end(), PLERROR, PLearn::SetIterator, word_sense_to_unique_id, word_to_senses, and PLearn::ws().

Referenced by getWordSenseUniqueId(), and getWordSenseUniqueIdSize().

bool PLearn::WordNetOntology::containsWord string  word  )  [inline]
 

Definition at line 313 of file WordNetOntology.h.

References containsWord(), and words_id.

Referenced by PLearn::Dictionary::build_(), containsWord(), PLearn::Dictionary::getId(), and main().

bool PLearn::WordNetOntology::containsWordId int  id  )  [inline]
 

Definition at line 314 of file WordNetOntology.h.

References containsWordId(), and words.

Referenced by containsWordId().

void PLearn::WordNetOntology::createBaseSynsets  ) 
 

Definition at line 140 of file WordNetOntology.cc.

References ADJ_OFFSET, ADJ_SS_ID, ADV_OFFSET, ADV_SS_ID, BOS_OFFSET, BOS_SS_ID, EOS_OFFSET, EOS_SS_ID, PLearn::Node::gloss, PLearn::Node::hereiam, PLearn::Set::insert(), NOUN_OFFSET, NOUN_SS_ID, NUMERIC_OFFSET, NUMERIC_SS_ID, OOV_OFFSET, OOV_SS_ID, PLearn::Node::parents, PROPER_NOUN_OFFSET, PROPER_NOUN_SS_ID, PUNCTUATION_OFFSET, PUNCTUATION_SS_ID, ROOT_OFFSET, ROOT_SS_ID, STOP_OFFSET, STOP_SS_ID, SUPER_UNKNOWN_OFFSET, SUPER_UNKNOWN_SS_ID, PLearn::Node::syns, synsets, PLearn::Node::types, UNDEFINED_TYPE, VERB_OFFSET, and VERB_SS_ID.

Referenced by WordNetOntology().

void PLearn::WordNetOntology::detectWordsWithoutOntology  ) 
 

Definition at line 2464 of file WordNetOntology.cc.

References c_str(), PLearn::Set::isEmpty(), PLWARNING, word_to_senses, and words.

Referenced by main().

void PLearn::WordNetOntology::extract string  voc_file,
int  wn_pos_type
 

Definition at line 282 of file WordNetOntology.cc.

References PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), extractWord(), finalize(), PLearn::ShellProgressBar::update(), and word_index.

Referenced by WordNetOntology().

void PLearn::WordNetOntology::extractAncestors Node node,
Set  ancestors,
int  word_coverage_threshold
 

Definition at line 1491 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), extractAncestors(), PLearn::Set::insert(), PLearn::Node::parents, PLearn::SetIterator, synset_to_word_descendants, and synsets.

void PLearn::WordNetOntology::extractAncestors Node node,
Set  ancestors,
int  level,
int  level_threshold
 

Definition at line 1517 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), extractAncestors(), PLearn::Set::insert(), PLearn::Node::parents, PLearn::SetIterator, and synsets.

void PLearn::WordNetOntology::extractAncestors int  threshold,
bool  cut_with_word_coverage,
bool  exclude_itself
 

Definition at line 1435 of file WordNetOntology.cc.

References are_ancestors_extracted, are_descendants_extracted, PLearn::Set::begin(), PLearn::Set::end(), PLearn::endl(), extractAncestors(), extractDescendants(), getSynsetAncestors(), PLearn::Set::insert(), PLearn::Set::merge(), PLearn::SetIterator, synset_to_ancestors, synsets, word_to_ancestors, and word_to_senses.

Referenced by PLearn::GraphicalBiText::compute_nodemap(), extractAncestors(), getSynsetAncestors(), printSynsetAncestors(), printWordAncestors(), and WordNetOntology().

void PLearn::WordNetOntology::extractDescendants  ) 
 

Definition at line 1807 of file WordNetOntology.cc.

References are_descendants_extracted, PLearn::endl(), synset_to_sense_descendants, synset_to_word_descendants, and synsets.

Referenced by extractAncestors(), extractDescendants(), extractStrictDescendants(), getSynsetSenseDescendants(), getSynsetWordDescendants(), and WordNetOntology().

void PLearn::WordNetOntology::extractDescendants Node node,
Set  sense_descendants,
Set  word_descendants
 

Definition at line 1833 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), extractDescendants(), PLearn::Set::insert(), isSense(), sense_to_words, PLearn::SetIterator, PLearn::Node::ss_id, and synsets.

Node * PLearn::WordNetOntology::extractOntology SynsetPtr  ssp  ) 
 

Definition at line 729 of file WordNetOntology.cc.

References checkForAlreadyExtractedSynset(), PLearn::Node::children, extractOntology(), PLearn::Node::fnum, getSynsetWords(), PLearn::Node::gloss, PLearn::Node::hereiam, PLearn::Set::insert(), PLearn::Node::is_unknown, PLearn::removeDelimiters(), PLearn::Node::ss_id, PLearn::Node::syns, synset_index, and synsets.

Referenced by extractOntology(), and extractSenses().

void PLearn::WordNetOntology::extractPredominentSyntacticClasses  ) 
 

Definition at line 2554 of file WordNetOntology.cc.

References are_predominent_pos_extracted, getPredominentSyntacticClassForWord(), word_to_predominent_pos, and word_to_senses.

bool PLearn::WordNetOntology::extractSenses string  original_word,
string  processed_word,
int  wn_pos_type
 

Definition at line 604 of file WordNetOntology.cc.

References adj_count, adj_sense_count, ADJ_TYPE, adv_count, adv_sense_count, ADV_TYPE, checkForAlreadyExtractedSynset(), PLearn::cstr(), extractOntology(), PLearn::Set::insert(), noun_count, noun_sense_count, NOUN_TYPE, sense_key_to_ss_id, sense_to_words, PLearn::Node::ss_id, PLearn::Node::types, verb_count, verb_sense_count, VERB_TYPE, word_to_adj_senses, word_to_adj_wnsn, word_to_adv_senses, word_to_adv_wnsn, word_to_noun_senses, word_to_noun_wnsn, word_to_senses, word_to_verb_senses, word_to_verb_wnsn, words_id, PLearn::ws(), and ws_id_to_sense_key.

Referenced by extractWord().

void PLearn::WordNetOntology::extractStrictDescendants Node node,
Set  sense_descendants,
Set  word_descendants
 

Definition at line 1852 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), extractDescendants(), PLearn::Set::insert(), isSense(), sense_to_words, PLearn::SetIterator, PLearn::Node::ss_id, and synsets.

void PLearn::WordNetOntology::extractTaggedWordFrequencies map< int, map< int, int > > &  word_senses_to_tagged_frequencies  ) 
 

Definition at line 489 of file WordNetOntology.cc.

References PLearn::cstr(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::endl(), findSynsetFromSynsAndGloss(), getSynsetWords(), PLearn::Node::ss_id, PLearn::ShellProgressBar::update(), and words.

void PLearn::WordNetOntology::extractWord string  original_word,
int  wn_pos_type,
bool  trim_word,
bool  stem_word,
bool  remove_underscores
 

Definition at line 383 of file WordNetOntology.cc.

References ADJ_TYPE, ADV_TYPE, ALL_WN_TYPE, c_str(), catchSpecialTags(), extractSenses(), in_wn_word_count, NOUN_TYPE, NULL_TAG, out_of_wn_word_count, PLWARNING, processUnknownWord(), PLearn::stemWord(), PLearn::trimWord(), PLearn::underscore_to_space(), VERB_TYPE, word_index, word_is_in_wn, word_to_senses, words, and words_id.

Referenced by PLearn::Dictionary::build_(), extract(), PLearn::Dictionary::getId(), and main().

void PLearn::WordNetOntology::extractWordHighLevelSenses int  noun_depth,
int  verb_depth,
int  adj_depth,
int  adv_depth,
int  unk_depth
 

Definition at line 2627 of file WordNetOntology.cc.

References ADJ_SS_ID, ADV_SS_ID, are_word_high_level_senses_extracted, PLearn::Set::begin(), PLearn::Set::end(), getDescendantCategoriesAtLevel(), getSynsetWordDescendants(), NOUN_SS_ID, PLearn::SetIterator, SUPER_UNKNOWN_SS_ID, VERB_SS_ID, word_to_high_level_senses, word_to_senses, and words.

void PLearn::WordNetOntology::extractWordNounAndVerbHighLevelSenses int  noun_depth,
int  verb_depth
 

Definition at line 2703 of file WordNetOntology.cc.

References are_word_high_level_senses_extracted, PLearn::Set::begin(), PLearn::Set::end(), getDescendantCategoriesAtLevel(), getSynsetWordDescendants(), NOUN_SS_ID, PLearn::SetIterator, VERB_SS_ID, word_to_adj_senses, word_to_adv_senses, word_to_high_level_senses, word_to_senses, word_to_under_target_level_high_level_senses, and words.

void PLearn::WordNetOntology::fillTempWordToHighLevelSensesTVecMap  )  [inline]
 

Definition at line 437 of file WordNetOntology.h.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::SetIterator, temp_word_to_high_level_senses, and words.

void PLearn::WordNetOntology::fillTempWordToSensesTVecMap  )  [inline]
 

Definition at line 392 of file WordNetOntology.h.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::SetIterator, temp_word_to_adj_senses, temp_word_to_adv_senses, temp_word_to_noun_senses, temp_word_to_senses, temp_word_to_verb_senses, word_to_adj_senses, word_to_adv_senses, word_to_noun_senses, word_to_senses, and word_to_verb_senses.

Referenced by PLearn::GraphicalBiText::build_().

void PLearn::WordNetOntology::finalize  ) 
 

Definition at line 819 of file WordNetOntology.cc.

References linkUpperCategories(), propagatePOSTypes(), and removeNonReachableSynsets().

Referenced by extract().

Node * PLearn::WordNetOntology::findSynsetFromSynsAndGloss const vector< string > &  syns,
const string gloss,
const long  offset,
const int  fnum
 

Definition at line 478 of file WordNetOntology.cc.

References PLearn::Node::fnum, PLearn::Node::gloss, PLearn::Node::hereiam, PLearn::Node::syns, and synsets.

Referenced by extractTaggedWordFrequencies().

Set PLearn::WordNetOntology::getAllCategories  ) 
 

Definition at line 2010 of file WordNetOntology.cc.

References PLearn::Set::insert(), and synsets.

Referenced by PLearn::GraphicalBiText::check_set_pA(), PLearn::GraphicalBiText::compute_BN_likelihood(), PLearn::GraphicalBiText::compute_efs_likelihood(), PLearn::GraphicalBiText::compute_likelihood(), PLearn::GraphicalBiText::compute_pTC(), and PLearn::GraphicalBiText::print().

Set PLearn::WordNetOntology::getAllSenses  ) 
 

Definition at line 2000 of file WordNetOntology.cc.

References PLearn::Set::insert(), and sense_to_words.

Set PLearn::WordNetOntology::getAllWords  ) 
 

Definition at line 1990 of file WordNetOntology.cc.

References PLearn::Set::insert(), and words.

Referenced by PLearn::GraphicalBiText::build_(), PLearn::GraphicalBiText::compute_likelihood(), PLearn::GraphicalBiText::compute_nodemap(), PLearn::GraphicalBiText::computeKL(), PLearn::GraphicalBiText::init(), main(), PLearn::GraphicalBiText::print(), PLearn::GraphicalBiText::print_sensemap(), and PLearn::GraphicalBiText::test_WSD().

void PLearn::WordNetOntology::getCategoriesAtLevel int  ss_id,
int  cur_level,
int  target_level,
set< int > &  categories
 

Definition at line 2168 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), getCategoriesAtLevel(), isTopLevelCategory(), PLearn::Node::parents, PLearn::SetIterator, and synsets.

Referenced by getCategoriesAtLevel(), reduceWordPolysemy(), and reduceWordPolysemy_preserveSenseOverlapping().

void PLearn::WordNetOntology::getCategoriesUnderLevel int  ss_id,
int  cur_level,
int  target_level,
Set  categories
 

Definition at line 2183 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), getCategoriesUnderLevel(), PLearn::Set::insert(), isTopLevelCategory(), PLearn::Node::parents, PLearn::SetIterator, and synsets.

Referenced by getCategoriesUnderLevel().

void PLearn::WordNetOntology::getDescendantCategoriesAtLevel int  ss_id,
int  cur_level,
int  target_level,
Set  categories
 

Definition at line 2602 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), getDescendantCategoriesAtLevel(), PLearn::Set::insert(), isSense(), isSynset(), sense_to_words, PLearn::SetIterator, synsets, word_to_under_target_level_high_level_senses, and words.

Referenced by extractWordHighLevelSenses(), extractWordNounAndVerbHighLevelSenses(), and getDescendantCategoriesAtLevel().

void PLearn::WordNetOntology::getDownToUpParentCategoriesAtLevel int  ss_id,
int  target_level,
Set  categories,
int  cur_level = 0
 

Definition at line 2155 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), getDownToUpParentCategoriesAtLevel(), PLearn::Set::insert(), isTopLevelCategory(), PLearn::Node::parents, PLearn::SetIterator, and synsets.

Referenced by getDownToUpParentCategoriesAtLevel().

TVec<int> PLearn::WordNetOntology::getHighLevelSensesForWord int  w  )  [inline]
 

Definition at line 447 of file WordNetOntology.h.

References getHighLevelSensesForWord(), and temp_word_to_high_level_senses.

Referenced by getHighLevelSensesForWord().

int PLearn::WordNetOntology::getMaxSynsetId  ) 
 

Definition at line 2475 of file WordNetOntology.cc.

References synsets.

Referenced by PLearn::GraphicalBiText::build_().

int PLearn::WordNetOntology::getPredominentSyntacticClassForWord int  word_id  ) 
 

Definition at line 2510 of file WordNetOntology.cc.

References ADJ_TYPE, ADV_TYPE, are_predominent_pos_extracted, PLearn::Set::begin(), PLearn::Set::end(), getSyntacticClassForSense(), isWord(), NOUN_TYPE, PLWARNING, PLearn::SetIterator, UNDEFINED_TYPE, VERB_TYPE, word_to_predominent_pos, and word_to_senses.

Referenced by extractPredominentSyntacticClasses(), and savePredominentSyntacticClasses().

Node* PLearn::WordNetOntology::getRootSynset  )  [inline]
 

Definition at line 284 of file WordNetOntology.h.

References ROOT_SS_ID, and synsets.

TVec<int> PLearn::WordNetOntology::getSecondLevelSensesForWord int  w  )  [inline]
 

Definition at line 449 of file WordNetOntology.h.

References PLearn::Set::begin(), PLearn::Set::end(), getSecondLevelSensesForWord(), PLearn::Set::insert(), PLearn::Node::parents, PLearn::TVec< T >::push_back(), PLearn::SetIterator, synsets, and word_to_senses.

Referenced by getSecondLevelSensesForWord().

string PLearn::WordNetOntology::getSenseKey int  word_id,
int  ss_id
 

Definition at line 1611 of file WordNetOntology.cc.

References PLearn::ws(), and ws_id_to_sense_key.

Referenced by PLearn::GraphicalBiText::compute_nodemap(), PLearn::GraphicalBiText::init(), PLearn::GraphicalBiText::init_WSD(), PLearn::GraphicalBiText::print(), PLearn::GraphicalBiText::senseTagBitext(), PLearn::GraphicalBiText::set_nodemap(), PLearn::GraphicalBiText::test_WSD(), and PLearn::GraphicalBiText::update_WSD_model().

TVec<int> PLearn::WordNetOntology::getSensesForWord int  w  )  [inline]
 

Definition at line 435 of file WordNetOntology.h.

References getSensesForWord(), and temp_word_to_senses.

Referenced by getSensesForWord(), PLearn::TextSenseSequenceVMatrix::permute(), PLearn::GraphicalBiText::print(), PLearn::GraphicalBiText::sensetag_valid_bitext(), PLearn::GraphicalBiText::senseTagBitext(), PLearn::GraphicalBiText::test_WSD(), and PLearn::GraphicalBiText::update_WSD_model().

int PLearn::WordNetOntology::getSenseSize  )  [inline]
 

Definition at line 289 of file WordNetOntology.h.

References sense_to_words.

Referenced by PLearn::TextSenseSequenceVMatrix::build_(), PLearn::GraphicalBiText::build_(), and printStats().

Node * PLearn::WordNetOntology::getSynset int  id  ) 
 

Definition at line 1755 of file WordNetOntology.cc.

References isSynset(), PLWARNING, and synsets.

Referenced by PLearn::GraphicalBiText::check_set_pA(), PLearn::GraphicalBiText::compute_node_level(), PLearn::GraphicalBiText::compute_nodemap(), PLearn::GraphicalBiText::compute_pMC(), PLearn::GraphicalBiText::getDeepestCommonAncestor(), PLearn::GraphicalBiText::printNode(), and PLearn::GraphicalBiText::set_nodemap().

Set PLearn::WordNetOntology::getSynsetAncestors int  id,
int  max_level = -1
 

Definition at line 1527 of file WordNetOntology.cc.

References are_ancestors_extracted, extractAncestors(), isSynset(), PLWARNING, synset_to_ancestors, and synsets.

Referenced by PLearn::GraphicalBiText::compute_BN_likelihood(), PLearn::GraphicalBiText::compute_efs_likelihood(), extractAncestors(), PLearn::GraphicalBiText::getDeepestCommonAncestor(), and getWordAncestors().

int PLearn::WordNetOntology::getSynsetIDForSenseKey int  word_id,
string  sense_key
 

Definition at line 1620 of file WordNetOntology.cc.

References sense_key_to_ss_id.

Referenced by PLearn::Dictionary::getId(), PLearn::GraphicalBiText::init(), PLearn::GraphicalBiText::init_WSD(), and PLearn::GraphicalBiText::test_WSD().

Set PLearn::WordNetOntology::getSynsetParents int  id  ) 
 

Definition at line 1557 of file WordNetOntology.cc.

References synsets.

Referenced by PLearn::GraphicalBiText::distribute_pS_on_ancestors().

Set PLearn::WordNetOntology::getSynsetSenseDescendants int  id  ) 
 

Definition at line 1867 of file WordNetOntology.cc.

References are_descendants_extracted, extractDescendants(), isSynset(), PLWARNING, synset_to_sense_descendants, and synsets.

int PLearn::WordNetOntology::getSynsetSize  )  [inline]
 

Definition at line 290 of file WordNetOntology.h.

References synsets.

Referenced by printStats().

Set PLearn::WordNetOntology::getSynsetWordDescendants int  id  ) 
 

Definition at line 1896 of file WordNetOntology.cc.

References are_descendants_extracted, extractDescendants(), isSynset(), PLWARNING, synset_to_word_descendants, and synsets.

Referenced by extractWordHighLevelSenses(), extractWordNounAndVerbHighLevelSenses(), and PLearn::GraphicalBiText::printNode().

vector< string > PLearn::WordNetOntology::getSynsetWords SynsetPtr  ssp  ) 
 

Definition at line 1056 of file WordNetOntology.cc.

References PLearn::removeDelimiters().

Referenced by checkForAlreadyExtractedSynset(), extractOntology(), extractTaggedWordFrequencies(), and getWordSenseIdForSenseKey().

Set PLearn::WordNetOntology::getSyntacticClassesForWord int  word_id  ) 
 

Definition at line 2480 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::Set::insert(), isWord(), PLWARNING, PLearn::SetIterator, synsets, PLearn::Node::types, and word_to_senses.

int PLearn::WordNetOntology::getSyntacticClassForSense int  sense_id  ) 
 

Definition at line 2497 of file WordNetOntology.cc.

References PLearn::Set::begin(), isSense(), PLWARNING, PLearn::Set::size(), synsets, and PLearn::Node::types.

Referenced by getPredominentSyntacticClassForWord().

TVec<int> PLearn::WordNetOntology::getThirdLevelSensesForWord int  w  )  [inline]
 

Definition at line 468 of file WordNetOntology.h.

References PLearn::Set::begin(), PLearn::Set::end(), getThirdLevelSensesForWord(), PLearn::Set::insert(), PLearn::Node::parents, PLearn::TVec< T >::push_back(), PLearn::SetIterator, synsets, and word_to_senses.

Referenced by getThirdLevelSensesForWord().

int PLearn::WordNetOntology::getVocSize  )  [inline]
 

Definition at line 288 of file WordNetOntology.h.

References words.

Referenced by PLearn::GraphicalBiText::build_(), PLearn::GraphicalBiText::print(), printStats(), and PLearn::Dictionary::size().

string PLearn::WordNetOntology::getWord int  id  ) 
 

Definition at line 1655 of file WordNetOntology.cc.

References isWord(), NULL_TAG, PLWARNING, and words.

Referenced by PLearn::GraphicalBiText::build_(), PLearn::Dictionary::getSymbol(), main(), and PLearn::TextSenseSequenceVMatrix::permute().

Set PLearn::WordNetOntology::getWordAdjSenses int  id  ) 
 

Definition at line 1719 of file WordNetOntology.cc.

References isWord(), PLWARNING, and word_to_adj_senses.

Set PLearn::WordNetOntology::getWordAdvSenses int  id  ) 
 

Definition at line 1731 of file WordNetOntology.cc.

References isWord(), PLWARNING, and word_to_adv_senses.

Set PLearn::WordNetOntology::getWordAncestors int  id,
int  max_level = -1
 

Definition at line 1562 of file WordNetOntology.cc.

References are_ancestors_extracted, getSynsetAncestors(), PLearn::Set::insert(), isWord(), PLearn::Set::merge(), PLWARNING, PLearn::SetIterator, word_to_ancestors, and word_to_senses.

Referenced by printWordAncestors().

Set PLearn::WordNetOntology::getWordHighLevelSenses int  id  ) 
 

Definition at line 1679 of file WordNetOntology.cc.

References are_word_high_level_senses_extracted, isWord(), PLERROR, PLWARNING, and word_to_high_level_senses.

int PLearn::WordNetOntology::getWordId string  word  ) 
 

Definition at line 1630 of file WordNetOntology.cc.

References OOV_TAG, and words_id.

Referenced by PLearn::GraphicalBiText::build_(), PLearn::Dictionary::getId(), PLearn::GraphicalBiText::init(), PLearn::GraphicalBiText::init_WSD(), main(), PLearn::TextSenseSequenceVMatrix::permute(), and PLearn::GraphicalBiText::test_WSD().

Set PLearn::WordNetOntology::getWordNounSenses int  id  ) 
 

Definition at line 1695 of file WordNetOntology.cc.

References isWord(), PLWARNING, and word_to_noun_senses.

Referenced by PLearn::GraphicalBiText::init().

int PLearn::WordNetOntology::getWordSenseIdForSenseKey string  lemma,
string  lexsn,
string  word
 

Definition at line 887 of file WordNetOntology.cc.

References PLearn::cstr(), PLearn::Node::fnum, getSynsetWords(), PLearn::Node::gloss, PLearn::Node::hereiam, PLearn::SetIterator, PLearn::Node::ss_id, PLearn::Node::syns, synsets, WNO_ERROR, word_to_senses, and words_id.

Referenced by main().

int PLearn::WordNetOntology::getWordSenseIdForWnsn string  word,
int  wn_pos_type,
int  wnsn
 

Definition at line 826 of file WordNetOntology.cc.

References ADJ_TYPE, ADV_TYPE, isWord(), NOUN_TYPE, PLWARNING, VERB_TYPE, WNO_ERROR, word_to_adj_wnsn, word_to_adv_wnsn, word_to_noun_wnsn, word_to_verb_wnsn, and words_id.

Set PLearn::WordNetOntology::getWordSenses int  id  ) 
 

Definition at line 1667 of file WordNetOntology.cc.

References isWord(), PLWARNING, and word_to_senses.

Referenced by PLearn::GraphicalBiText::compute_BN_likelihood(), PLearn::GraphicalBiText::compute_nodemap(), PLearn::GraphicalBiText::compute_pTC(), main(), PLearn::GraphicalBiText::print_sensemap(), and PLearn::GraphicalBiText::set_nodemap().

int PLearn::WordNetOntology::getWordSenseUniqueId int  word,
int  sense
 

Definition at line 2753 of file WordNetOntology.cc.

References are_word_sense_unique_ids_computed, computeWordSenseUniqueIds(), word_sense_to_unique_id, and PLearn::ws().

int PLearn::WordNetOntology::getWordSenseUniqueIdSize  ) 
 

Definition at line 2782 of file WordNetOntology.cc.

References are_word_sense_unique_ids_computed, computeWordSenseUniqueIds(), and word_sense_to_unique_id.

Set PLearn::WordNetOntology::getWordsForSense int  id  ) 
 

Definition at line 1743 of file WordNetOntology.cc.

References isSense(), PLWARNING, and sense_to_words.

Referenced by PLearn::TextSenseSequenceVMatrix::build_().

Set PLearn::WordNetOntology::getWordVerbSenses int  id  ) 
 

Definition at line 1707 of file WordNetOntology.cc.

References isWord(), PLWARNING, and word_to_verb_senses.

bool PLearn::WordNetOntology::hasSenseInWordNet string  word,
int  wn_pos_type
 

Definition at line 352 of file WordNetOntology.cc.

References ADJ_TYPE, ADV_TYPE, PLearn::cstr(), NOUN_TYPE, and VERB_TYPE.

Referenced by isInWordNet().

void PLearn::WordNetOntology::init bool  differentiate_unknown_words = true  ) 
 

Definition at line 106 of file WordNetOntology.cc.

References adj_count, adj_sense_count, adv_count, adv_sense_count, are_ancestors_extracted, are_descendants_extracted, are_predominent_pos_extracted, are_word_high_level_senses_extracted, are_word_sense_unique_ids_computed, differentiate_unknown_words, EOS_SS_ID, in_wn_word_count, n_word_high_level_senses, noun_count, noun_sense_count, out_of_wn_word_count, synset_index, unknown_sense_index, verb_count, verb_sense_count, and word_index.

Referenced by WordNetOntology().

void PLearn::WordNetOntology::intersectAncestorsAndSenses Set  categories,
Set  senses
 

Definition at line 2053 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::clear(), PLearn::Set::contains(), PLearn::Set::end(), PLearn::Set::insert(), sense_to_words, PLearn::SetIterator, synset_to_ancestors, synsets, word_to_ancestors, and word_to_senses.

bool PLearn::WordNetOntology::isCategory int  id  ) 
 

Definition at line 1962 of file WordNetOntology.cc.

References isSynset().

Referenced by isPureCategory().

bool PLearn::WordNetOntology::isInWordNet int  word_id  ) 
 

Definition at line 1599 of file WordNetOntology.cc.

References isWord(), PLWARNING, and word_is_in_wn.

bool PLearn::WordNetOntology::isInWordNet string  word,
bool  trim_word = true,
bool  stem_word = true,
bool  remove_undescores = false
 

Definition at line 303 of file WordNetOntology.cc.

References ADJ_TYPE, ADV_TYPE, hasSenseInWordNet(), NOUN_TYPE, NULL_TAG, PLearn::stemWord(), PLearn::trimWord(), PLearn::underscore_to_space(), and VERB_TYPE.

Referenced by main().

bool PLearn::WordNetOntology::isPureCategory int  id  ) 
 

Definition at line 1967 of file WordNetOntology.cc.

References isCategory(), and isSense().

Referenced by PLearn::GraphicalBiText::compute_pTC().

bool PLearn::WordNetOntology::isPureSense int  id  ) 
 

Definition at line 1957 of file WordNetOntology.cc.

References isSense(), and synsets.

Referenced by PLearn::GraphicalBiText::compute_pTC().

bool PLearn::WordNetOntology::isSense int  id  ) 
 

Definition at line 1952 of file WordNetOntology.cc.

References sense_to_words.

Referenced by extractDescendants(), extractStrictDescendants(), getDescendantCategoriesAtLevel(), getSyntacticClassForSense(), getWordsForSense(), PLearn::GraphicalBiText::init(), PLearn::GraphicalBiText::init_WSD(), isPureCategory(), isPureSense(), and lookForSpecialTags().

bool PLearn::WordNetOntology::isSynset int  id  ) 
 

Definition at line 1972 of file WordNetOntology.cc.

References synsets.

Referenced by PLearn::GraphicalBiText::compute_node_level(), PLearn::GraphicalBiText::compute_nodemap(), PLearn::GraphicalBiText::compute_pMC(), getDescendantCategoriesAtLevel(), getSynset(), getSynsetAncestors(), getSynsetSenseDescendants(), getSynsetWordDescendants(), isCategory(), printInvertedSynsetOntology(), and PLearn::GraphicalBiText::set_nodemap().

bool PLearn::WordNetOntology::isSynsetUnknown int  id  ) 
 

Definition at line 2120 of file WordNetOntology.cc.

References synsets.

bool PLearn::WordNetOntology::isTopLevelCategory int  ss_id  ) 
 

Definition at line 2591 of file WordNetOntology.cc.

References ADJ_SS_ID, ADV_SS_ID, BOS_SS_ID, EOS_SS_ID, NOUN_SS_ID, NUMERIC_SS_ID, OOV_SS_ID, PROPER_NOUN_SS_ID, PUNCTUATION_SS_ID, ROOT_SS_ID, STOP_SS_ID, SUPER_UNKNOWN_SS_ID, UNDEFINED_SS_ID, and VERB_SS_ID.

Referenced by getCategoriesAtLevel(), getCategoriesUnderLevel(), and getDownToUpParentCategoriesAtLevel().

bool PLearn::WordNetOntology::isWord string  word  ) 
 

Definition at line 1947 of file WordNetOntology.cc.

References words_id.

bool PLearn::WordNetOntology::isWord int  id  ) 
 

Definition at line 1942 of file WordNetOntology.cc.

References words.

Referenced by PLearn::GraphicalBiText::compute_likelihood(), getPredominentSyntacticClassForWord(), getSyntacticClassesForWord(), getWord(), getWordAdjSenses(), getWordAdvSenses(), getWordAncestors(), getWordHighLevelSenses(), getWordNounSenses(), getWordSenseIdForWnsn(), getWordSenses(), getWordVerbSenses(), PLearn::GraphicalBiText::init(), PLearn::GraphicalBiText::init_WSD(), isInWordNet(), PLearn::GraphicalBiText::sensetag_valid_bitext(), PLearn::GraphicalBiText::senseTagBitext(), PLearn::GraphicalBiText::test_WSD(), and PLearn::GraphicalBiText::update_WSD_model().

bool PLearn::WordNetOntology::isWordUnknown int  id  ) 
 

Definition at line 2109 of file WordNetOntology.cc.

References PLearn::SetIterator, synsets, and word_to_senses.

bool PLearn::WordNetOntology::isWordUnknown string  word  ) 
 

Definition at line 2104 of file WordNetOntology.cc.

References isWordUnknown(), and words_id.

Referenced by isWordUnknown().

void PLearn::WordNetOntology::linkUpperCategories  ) 
 

Definition at line 974 of file WordNetOntology.cc.

References ADJ_SS_ID, ADJ_TYPE, ADV_SS_ID, ADV_TYPE, PLearn::Set::contains(), PLearn::Set::insert(), NOUN_SS_ID, NOUN_TYPE, PLearn::Node::parents, ROOT_SS_ID, PLearn::Set::size(), synsets, PLearn::Node::types, VERB_SS_ID, and VERB_TYPE.

Referenced by finalize().

void PLearn::WordNetOntology::load string  voc_file,
string  synset_file,
string  ontology_file,
string  sense_key_file
 

Definition at line 1392 of file WordNetOntology.cc.

References PLearn::load(), PLERROR, sense_key_to_ss_id, PLearn::split(), PLearn::toint(), PLearn::ws(), and ws_id_to_sense_key.

void PLearn::WordNetOntology::load string  voc_file,
string  synset_file,
string  ontology_file
 

Definition at line 1267 of file WordNetOntology.cc.

References ADJ_TYPE, ADV_TYPE, PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Node::fnum, PLearn::Node::gloss, PLearn::Node::hereiam, in_wn_word_count, PLearn::Set::insert(), NOUN_TYPE, out_of_wn_word_count, PLERROR, PLWARNING, sense_to_words, PLearn::SetIterator, PLearn::split(), PLearn::Node::ss_id, PLearn::startsWith(), PLearn::Node::syns, synset_index, synsets, PLearn::tobool(), PLearn::toint(), PLearn::tolong(), PLearn::Node::types, unknown_sense_index, PLearn::ShellProgressBar::update(), VERB_TYPE, word_index, word_is_in_wn, word_to_adj_senses, word_to_adv_senses, word_to_noun_senses, word_to_senses, word_to_verb_senses, words, and words_id.

void PLearn::WordNetOntology::loadPredominentSyntacticClasses string  file  ) 
 

Definition at line 2576 of file WordNetOntology.cc.

References are_predominent_pos_extracted, PLearn::pgetline(), PLearn::toint(), and word_to_predominent_pos.

void PLearn::WordNetOntology::lookForSpecialTags  ) 
 

Definition at line 805 of file WordNetOntology.cc.

References isSense(), NUMERIC_SS_ID, OOV_SS_ID, PLWARNING, PROPER_NOUN_SS_ID, PUNCTUATION_SS_ID, and STOP_SS_ID.

int PLearn::WordNetOntology::overlappingSynsets int  ss_id1,
int  ss_id2
 

Definition at line 1977 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::contains(), PLearn::Set::end(), PLearn::Set::insert(), sense_to_words, PLearn::SetIterator, and PLearn::Set::size().

void PLearn::WordNetOntology::print bool  print_ontology = true  ) 
 

Definition at line 1070 of file WordNetOntology.cc.

References PLearn::endl(), printOntology(), printSynset(), PLearn::SetIterator, synsets, word_to_senses, and words.

Referenced by main().

void PLearn::WordNetOntology::printDescendants  ) 
 

Definition at line 1925 of file WordNetOntology.cc.

void PLearn::WordNetOntology::printInvertedSynsetOntology int  id,
int  level = 0
 

Definition at line 2036 of file WordNetOntology.cc.

References isSynset(), PLWARNING, printInvertedSynsetOntology(), printSynset(), PLearn::SetIterator, and synsets.

Referenced by printInvertedSynsetOntology().

void PLearn::WordNetOntology::printNodes  ) 
 

Definition at line 1416 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), PLearn::endl(), PLearn::Node::parents, PLearn::SetIterator, PLearn::Node::ss_id, and synsets.

void PLearn::WordNetOntology::printOntology Node node,
int  level = 0
 

Definition at line 1086 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::Node::parents, printOntology(), printSynset(), PLearn::SetIterator, and synsets.

Referenced by print(), printOntology(), and printWordOntology().

void PLearn::WordNetOntology::printStats  ) 
 

Definition at line 1151 of file WordNetOntology.cc.

References are_word_high_level_senses_extracted, PLearn::endl(), getSenseSize(), getSynsetSize(), getVocSize(), in_wn_word_count, n_word_high_level_senses, and out_of_wn_word_count.

Referenced by main().

void PLearn::WordNetOntology::printSynset int  ss_id,
ostream &  sout,
int  indent_level = 0
 

Definition at line 1134 of file WordNetOntology.cc.

References PLearn::endl(), and synsets.

void PLearn::WordNetOntology::printSynset int  ss_id,
int  indent_level = 0
 

Definition at line 1095 of file WordNetOntology.cc.

References PLearn::endl(), and synsets.

Referenced by PLearn::GraphicalBiText::compute_pMC(), PLearn::GraphicalBiText::init(), print(), printInvertedSynsetOntology(), printOntology(), printWordOntology(), and reduceWordPolysemy_preserveSenseOverlapping().

void PLearn::WordNetOntology::printSynsetAncestors  ) 
 

Definition at line 1773 of file WordNetOntology.cc.

References are_ancestors_extracted, PLearn::endl(), extractAncestors(), PLearn::SetIterator, synset_to_ancestors, and WORD_COVERAGE_THRESHOLD.

void PLearn::WordNetOntology::printWordAncestors  ) 
 

Definition at line 1788 of file WordNetOntology.cc.

References are_ancestors_extracted, PLearn::Set::begin(), PLearn::Set::end(), PLearn::endl(), extractAncestors(), getWordAncestors(), PLearn::SetIterator, WORD_COVERAGE_THRESHOLD, and word_to_senses.

void PLearn::WordNetOntology::printWordOntology string  word  ) 
 

Definition at line 2031 of file WordNetOntology.cc.

References printWordOntology(), and words_id.

void PLearn::WordNetOntology::printWordOntology int  id  ) 
 

Definition at line 2020 of file WordNetOntology.cc.

References PLearn::endl(), printOntology(), printSynset(), PLearn::SetIterator, synsets, word_to_senses, and words.

Referenced by printWordOntology().

void PLearn::WordNetOntology::processUnknownWord int  word_id  ) 
 

Definition at line 909 of file WordNetOntology.cc.

References differentiate_unknown_words, EOS_OFFSET, PLearn::Node::gloss, PLearn::Node::hereiam, PLearn::Set::insert(), PLearn::Node::parents, sense_to_words, PLearn::Node::ss_id, SUPER_UNKNOWN_SS_ID, PLearn::Node::syns, synset_index, synsets, PLearn::tostring(), PLearn::Node::types, UNDEFINED_TYPE, unknown_sense_index, and word_to_senses.

Referenced by extractWord().

void PLearn::WordNetOntology::propagatePOSTypes Node node  ) 
 

Definition at line 946 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::Set::insert(), PLearn::Node::parents, PLWARNING, propagatePOSTypes(), PLearn::SetIterator, PLearn::Set::size(), synsets, PLearn::Node::types, and PLearn::Node::visited.

void PLearn::WordNetOntology::propagatePOSTypes  ) 
 

Definition at line 936 of file WordNetOntology.cc.

References sense_to_words, synsets, and unvisitAll().

Referenced by finalize(), and propagatePOSTypes().

void PLearn::WordNetOntology::reducePolysemy int  level  ) 
 

Definition at line 2195 of file WordNetOntology.cc.

References count, PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::ShellProgressBar::init(), reduceWordPolysemy_preserveSenseOverlapping(), removeNonReachableSynsets(), PLearn::ShellProgressBar::update(), and words.

void PLearn::WordNetOntology::reduceWordPolysemy int  word_id,
int  level
 

Definition at line 2215 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), getCategoriesAtLevel(), PLearn::Set::insert(), PLearn::Set::remove(), sense_to_words, PLearn::SetIterator, PLearn::Set::size(), word_to_adj_senses, word_to_adv_senses, word_to_noun_senses, word_to_senses, and word_to_verb_senses.

void PLearn::WordNetOntology::reduceWordPolysemy_preserveSenseOverlapping int  word_id,
int  level
 

Definition at line 2270 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::endl(), getCategoriesAtLevel(), PLearn::Set::insert(), PLearn::Set::isEmpty(), printSynset(), PLearn::Set::remove(), sense_to_words, PLearn::SetIterator, PLearn::Set::size(), word_to_adj_senses, word_to_adv_senses, word_to_noun_senses, word_to_senses, word_to_verb_senses, and words.

Referenced by reducePolysemy().

void PLearn::WordNetOntology::reduceWordPolysemy_preserveSenseOverlapping2 int  word_id,
int  level
 

Definition at line 2332 of file WordNetOntology.cc.

void PLearn::WordNetOntology::removeNonReachableSynsets  ) 
 

Definition at line 2373 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), PLearn::Set::insert(), PLearn::Set::remove(), PLearn::SetIterator, synsets, unvisitAll(), PLearn::Node::visited, visitUpward(), and word_to_senses.

Referenced by PLearn::GraphicalBiText::build_(), finalize(), and reducePolysemy().

void PLearn::WordNetOntology::removeWord int  id  ) 
 

Definition at line 2422 of file WordNetOntology.cc.

References word_to_adj_senses, word_to_adj_wnsn, word_to_adv_senses, word_to_adv_wnsn, word_to_high_level_senses, word_to_noun_senses, word_to_noun_wnsn, word_to_predominent_pos, word_to_senses, word_to_verb_senses, word_to_verb_wnsn, words, and words_id.

Referenced by PLearn::GraphicalBiText::build_().

void PLearn::WordNetOntology::save string  synset_file,
string  ontology_file,
string  sense_key_file
 

Definition at line 1254 of file WordNetOntology.cc.

References PLearn::endl(), PLearn::save(), and ws_id_to_sense_key.

void PLearn::WordNetOntology::save string  voc_file  ) 
 

Definition at line 1229 of file WordNetOntology.cc.

References PLearn::endl(), and words.

void PLearn::WordNetOntology::save string  synset_file,
string  ontology_file
 

Definition at line 1177 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), PLearn::endl(), PLearn::Node::fnum, PLearn::Node::gloss, PLearn::Node::hereiam, sense_to_words, PLearn::SetIterator, PLearn::Node::syns, synsets, PLearn::Node::types, word_is_in_wn, and word_to_senses.

Referenced by main().

void PLearn::WordNetOntology::savePredominentSyntacticClasses string  file  ) 
 

Definition at line 2564 of file WordNetOntology.cc.

References PLearn::endl(), getPredominentSyntacticClassForWord(), and word_to_senses.

void PLearn::WordNetOntology::saveVocInWordnet string  voc_file  ) 
 

Definition at line 1240 of file WordNetOntology.cc.

References PLearn::endl(), word_is_in_wn, and words.

void PLearn::WordNetOntology::unvisitAll  ) 
 

Definition at line 967 of file WordNetOntology.cc.

References synsets.

Referenced by propagatePOSTypes(), and removeNonReachableSynsets().

void PLearn::WordNetOntology::unvisitDownward Node node  ) 
 

Definition at line 2454 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), PLearn::SetIterator, synsets, unvisitDownward(), and PLearn::Node::visited.

Referenced by unvisitDownward().

void PLearn::WordNetOntology::visitUpward Node node  ) 
 

Definition at line 2442 of file WordNetOntology.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::Node::parents, PLearn::SetIterator, synsets, PLearn::Node::visited, and visitUpward().

Referenced by removeNonReachableSynsets(), and visitUpward().


Member Data Documentation

int PLearn::WordNetOntology::adj_count [protected]
 

Definition at line 200 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::adj_sense_count [protected]
 

Definition at line 205 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::adv_count [protected]
 

Definition at line 201 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::adv_sense_count [protected]
 

Definition at line 206 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

bool PLearn::WordNetOntology::are_ancestors_extracted [protected]
 

Definition at line 212 of file WordNetOntology.h.

Referenced by extractAncestors(), getSynsetAncestors(), getWordAncestors(), init(), printSynsetAncestors(), and printWordAncestors().

bool PLearn::WordNetOntology::are_descendants_extracted [protected]
 

Definition at line 213 of file WordNetOntology.h.

Referenced by extractAncestors(), extractDescendants(), getSynsetSenseDescendants(), getSynsetWordDescendants(), and init().

bool PLearn::WordNetOntology::are_predominent_pos_extracted [protected]
 

Definition at line 214 of file WordNetOntology.h.

Referenced by extractPredominentSyntacticClasses(), getPredominentSyntacticClassForWord(), init(), and loadPredominentSyntacticClasses().

bool PLearn::WordNetOntology::are_word_high_level_senses_extracted [protected]
 

Definition at line 215 of file WordNetOntology.h.

Referenced by extractWordHighLevelSenses(), extractWordNounAndVerbHighLevelSenses(), getWordHighLevelSenses(), init(), and printStats().

bool PLearn::WordNetOntology::are_word_sense_unique_ids_computed [protected]
 

Definition at line 216 of file WordNetOntology.h.

Referenced by computeWordSenseUniqueIds(), getWordSenseUniqueId(), getWordSenseUniqueIdSize(), and init().

bool PLearn::WordNetOntology::differentiate_unknown_words [protected]
 

Definition at line 225 of file WordNetOntology.h.

Referenced by init(), and processUnknownWord().

int PLearn::WordNetOntology::in_wn_word_count [protected]
 

Definition at line 208 of file WordNetOntology.h.

Referenced by extractWord(), init(), load(), and printStats().

int PLearn::WordNetOntology::n_word_high_level_senses [protected]
 

Definition at line 218 of file WordNetOntology.h.

Referenced by init(), and printStats().

int PLearn::WordNetOntology::noun_count [protected]
 

Definition at line 198 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::noun_sense_count [protected]
 

Definition at line 203 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::out_of_wn_word_count [protected]
 

Definition at line 209 of file WordNetOntology.h.

Referenced by extractWord(), init(), load(), and printStats().

map< pair<int, string>,int> PLearn::WordNetOntology::sense_key_to_ss_id [protected]
 

Definition at line 190 of file WordNetOntology.h.

Referenced by extractSenses(), getSynsetIDForSenseKey(), and load().

map<int, Set> PLearn::WordNetOntology::sense_to_words [protected]
 

Definition at line 173 of file WordNetOntology.h.

Referenced by catchSpecialTags(), extractDescendants(), extractSenses(), extractStrictDescendants(), getAllSenses(), getDescendantCategoriesAtLevel(), getSenseSize(), getWordsForSense(), intersectAncestorsAndSenses(), isSense(), load(), overlappingSynsets(), processUnknownWord(), propagatePOSTypes(), reduceWordPolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), and save().

int PLearn::WordNetOntology::synset_index [protected]
 

Definition at line 194 of file WordNetOntology.h.

Referenced by extractOntology(), init(), load(), and processUnknownWord().

map<int, Set> PLearn::WordNetOntology::synset_to_ancestors [protected]
 

Definition at line 174 of file WordNetOntology.h.

Referenced by extractAncestors(), getSynsetAncestors(), intersectAncestorsAndSenses(), and printSynsetAncestors().

map<int, Set> PLearn::WordNetOntology::synset_to_sense_descendants [protected]
 

Definition at line 176 of file WordNetOntology.h.

Referenced by extractDescendants(), and getSynsetSenseDescendants().

map<int, Set> PLearn::WordNetOntology::synset_to_word_descendants [protected]
 

Definition at line 177 of file WordNetOntology.h.

Referenced by extractAncestors(), extractDescendants(), and getSynsetWordDescendants().

map<int, Node*> PLearn::WordNetOntology::synsets [protected]
 

Definition at line 178 of file WordNetOntology.h.

Referenced by checkForAlreadyExtractedSynset(), createBaseSynsets(), extractAncestors(), extractDescendants(), extractOntology(), extractStrictDescendants(), findSynsetFromSynsAndGloss(), getAllCategories(), getCategoriesAtLevel(), getCategoriesUnderLevel(), getDescendantCategoriesAtLevel(), getDownToUpParentCategoriesAtLevel(), getMaxSynsetId(), getRootSynset(), getSecondLevelSensesForWord(), getSynset(), getSynsetAncestors(), getSynsetParents(), getSynsetSenseDescendants(), getSynsetSize(), getSynsetWordDescendants(), getSyntacticClassesForWord(), getSyntacticClassForSense(), getThirdLevelSensesForWord(), getWordSenseIdForSenseKey(), intersectAncestorsAndSenses(), isPureSense(), isSynset(), isSynsetUnknown(), isWordUnknown(), linkUpperCategories(), load(), print(), printInvertedSynsetOntology(), printNodes(), printOntology(), printSynset(), printWordOntology(), processUnknownWord(), propagatePOSTypes(), removeNonReachableSynsets(), save(), unvisitAll(), unvisitDownward(), and visitUpward().

map<int, TVec<int> > PLearn::WordNetOntology::temp_word_to_adj_senses
 

Definition at line 388 of file WordNetOntology.h.

Referenced by fillTempWordToSensesTVecMap(), PLearn::TextSenseSequenceVMatrix::permute(), and PLearn::GraphicalBiText::test_WSD().

map<int, TVec<int> > PLearn::WordNetOntology::temp_word_to_adv_senses
 

Definition at line 389 of file WordNetOntology.h.

Referenced by fillTempWordToSensesTVecMap(), PLearn::TextSenseSequenceVMatrix::permute(), and PLearn::GraphicalBiText::test_WSD().

map<int, TVec<int> > PLearn::WordNetOntology::temp_word_to_high_level_senses
 

Definition at line 390 of file WordNetOntology.h.

Referenced by fillTempWordToHighLevelSensesTVecMap(), and getHighLevelSensesForWord().

map<int, TVec<int> > PLearn::WordNetOntology::temp_word_to_noun_senses
 

Definition at line 386 of file WordNetOntology.h.

Referenced by fillTempWordToSensesTVecMap(), PLearn::TextSenseSequenceVMatrix::permute(), and PLearn::GraphicalBiText::test_WSD().

map<int, TVec<int> > PLearn::WordNetOntology::temp_word_to_senses
 

Definition at line 385 of file WordNetOntology.h.

Referenced by fillTempWordToSensesTVecMap(), and getSensesForWord().

map<int, TVec<int> > PLearn::WordNetOntology::temp_word_to_verb_senses
 

Definition at line 387 of file WordNetOntology.h.

Referenced by fillTempWordToSensesTVecMap(), PLearn::TextSenseSequenceVMatrix::permute(), and PLearn::GraphicalBiText::test_WSD().

int PLearn::WordNetOntology::unknown_sense_index [protected]
 

Definition at line 195 of file WordNetOntology.h.

Referenced by init(), load(), and processUnknownWord().

int PLearn::WordNetOntology::verb_count [protected]
 

Definition at line 199 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::verb_sense_count [protected]
 

Definition at line 204 of file WordNetOntology.h.

Referenced by extractSenses(), and init().

int PLearn::WordNetOntology::word_index [protected]
 

Definition at line 193 of file WordNetOntology.h.

Referenced by extract(), extractWord(), init(), and load().

map<int, bool> PLearn::WordNetOntology::word_is_in_wn [protected]
 

Definition at line 186 of file WordNetOntology.h.

Referenced by extractWord(), isInWordNet(), load(), save(), and saveVocInWordnet().

map<pair<int, int>, int> PLearn::WordNetOntology::word_sense_to_unique_id [protected]
 

Definition at line 188 of file WordNetOntology.h.

Referenced by computeWordSenseUniqueIds(), getWordSenseUniqueId(), and getWordSenseUniqueIdSize().

map<int, Set> PLearn::WordNetOntology::word_to_adj_senses [protected]
 

Definition at line 171 of file WordNetOntology.h.

Referenced by extractSenses(), extractWordNounAndVerbHighLevelSenses(), fillTempWordToSensesTVecMap(), getWordAdjSenses(), load(), reduceWordPolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), and removeWord().

map<int, vector<int> > PLearn::WordNetOntology::word_to_adj_wnsn [protected]
 

Definition at line 183 of file WordNetOntology.h.

Referenced by extractSenses(), getWordSenseIdForWnsn(), and removeWord().

map<int, Set> PLearn::WordNetOntology::word_to_adv_senses [protected]
 

Definition at line 172 of file WordNetOntology.h.

Referenced by extractSenses(), extractWordNounAndVerbHighLevelSenses(), fillTempWordToSensesTVecMap(), getWordAdvSenses(), load(), reduceWordPolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), and removeWord().

map<int, vector<int> > PLearn::WordNetOntology::word_to_adv_wnsn [protected]
 

Definition at line 184 of file WordNetOntology.h.

Referenced by extractSenses(), getWordSenseIdForWnsn(), and removeWord().

map<int, Set> PLearn::WordNetOntology::word_to_ancestors [protected]
 

Definition at line 175 of file WordNetOntology.h.

Referenced by extractAncestors(), getWordAncestors(), and intersectAncestorsAndSenses().

map<int, Set> PLearn::WordNetOntology::word_to_high_level_senses [protected]
 

Definition at line 187 of file WordNetOntology.h.

Referenced by extractWordHighLevelSenses(), extractWordNounAndVerbHighLevelSenses(), getWordHighLevelSenses(), and removeWord().

map<int, Set> PLearn::WordNetOntology::word_to_noun_senses [protected]
 

Definition at line 169 of file WordNetOntology.h.

Referenced by extractSenses(), fillTempWordToSensesTVecMap(), getWordNounSenses(), load(), reduceWordPolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), and removeWord().

map<int, vector<int> > PLearn::WordNetOntology::word_to_noun_wnsn [protected]
 

Definition at line 181 of file WordNetOntology.h.

Referenced by extractSenses(), getWordSenseIdForWnsn(), and removeWord().

map<int, int> PLearn::WordNetOntology::word_to_predominent_pos [protected]
 

Definition at line 185 of file WordNetOntology.h.

Referenced by extractPredominentSyntacticClasses(), getPredominentSyntacticClassForWord(), loadPredominentSyntacticClasses(), and removeWord().

map<int, Set> PLearn::WordNetOntology::word_to_senses [protected]
 

Definition at line 168 of file WordNetOntology.h.

Referenced by catchSpecialTags(), computeWordSenseUniqueIds(), detectWordsWithoutOntology(), extractAncestors(), extractPredominentSyntacticClasses(), extractSenses(), extractWord(), extractWordHighLevelSenses(), extractWordNounAndVerbHighLevelSenses(), fillTempWordToSensesTVecMap(), getPredominentSyntacticClassForWord(), getSecondLevelSensesForWord(), getSyntacticClassesForWord(), getThirdLevelSensesForWord(), getWordAncestors(), getWordSenseIdForSenseKey(), getWordSenses(), intersectAncestorsAndSenses(), isWordUnknown(), load(), print(), printWordAncestors(), printWordOntology(), processUnknownWord(), reduceWordPolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), removeNonReachableSynsets(), removeWord(), save(), and savePredominentSyntacticClasses().

map<int, Set> PLearn::WordNetOntology::word_to_under_target_level_high_level_senses [protected]
 

Definition at line 189 of file WordNetOntology.h.

Referenced by extractWordNounAndVerbHighLevelSenses(), and getDescendantCategoriesAtLevel().

map<int, Set> PLearn::WordNetOntology::word_to_verb_senses [protected]
 

Definition at line 170 of file WordNetOntology.h.

Referenced by extractSenses(), fillTempWordToSensesTVecMap(), getWordVerbSenses(), load(), reduceWordPolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), and removeWord().

map<int, vector<int> > PLearn::WordNetOntology::word_to_verb_wnsn [protected]
 

Definition at line 182 of file WordNetOntology.h.

Referenced by extractSenses(), getWordSenseIdForWnsn(), and removeWord().

map<int, string> PLearn::WordNetOntology::words [protected]
 

Definition at line 179 of file WordNetOntology.h.

Referenced by containsWordId(), detectWordsWithoutOntology(), extractTaggedWordFrequencies(), extractWord(), extractWordHighLevelSenses(), extractWordNounAndVerbHighLevelSenses(), fillTempWordToHighLevelSensesTVecMap(), getAllWords(), getDescendantCategoriesAtLevel(), getVocSize(), getWord(), isWord(), load(), print(), printWordOntology(), reducePolysemy(), reduceWordPolysemy_preserveSenseOverlapping(), removeWord(), save(), and saveVocInWordnet().

map<string, int> PLearn::WordNetOntology::words_id [protected]
 

Definition at line 180 of file WordNetOntology.h.

Referenced by catchSpecialTags(), containsWord(), extractSenses(), extractWord(), getWordId(), getWordSenseIdForSenseKey(), getWordSenseIdForWnsn(), isWord(), isWordUnknown(), load(), printWordOntology(), and removeWord().

map<pair<int,int>, string> PLearn::WordNetOntology::ws_id_to_sense_key [protected]
 

Definition at line 191 of file WordNetOntology.h.

Referenced by extractSenses(), getSenseKey(), load(), and save().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:40 2004 for PLearn by doxygen 1.3.7