gov.llnl.ontology.wordnet
Class FileBasedInformationContent

java.lang.Object
  extended by gov.llnl.ontology.wordnet.FileBasedInformationContent
All Implemented Interfaces:
InformationContent

public class FileBasedInformationContent
extends Object
implements InformationContent

This InformationContent implementation loads the content data from plain text based file where each line contains an offset, part of speech, and content count. This is the typical format used content files distributed with the WordNet::Similarity perl package.

Author:
Keith Stevens

Constructor Summary
FileBasedInformationContent(String icFilename)
          Creates a FileBasedInformationContent from the provided file name.
 
Method Summary
 double contentForPartOfSpeech(Synset.PartsOfSpeech pos)
          Returns the raw content counts for a given Synset.PartsOfSpeech
 double contentForSynset(Synset synset)
          Returns the raw content counts for a given Sysnet.
 double informationContent(Synset synset)
          Returns the information theoretic content value for a given Synset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBasedInformationContent

public FileBasedInformationContent(String icFilename)
Creates a FileBasedInformationContent from the provided file name. tThis InformationContent should only be loaded after initializing the WordNetCorpusReader.

Throws:
IllegalArgumentException - When an offset id does not match any known offset value in wordnet as this is indicitive that the incorrect content file is being used.
Method Detail

contentForSynset

public double contentForSynset(Synset synset)
Returns the raw content counts for a given Sysnet. If there is no content value, -1 is returned.

Specified by:
contentForSynset in interface InformationContent

contentForPartOfSpeech

public double contentForPartOfSpeech(Synset.PartsOfSpeech pos)
Returns the raw content counts for a given Synset.PartsOfSpeech

Specified by:
contentForPartOfSpeech in interface InformationContent

informationContent

public double informationContent(Synset synset)
Returns the information theoretic content value for a given Synset. If there is no content value, -1 is returned.

Specified by:
informationContent in interface InformationContent


Copyright © 2010-2011. All Rights Reserved.