phrase nets
Classes | Public Member Functions
pn::parse::ParseResult Class Reference

List of all members.

Classes

class  Adjacency
class  Link

Public Member Functions

 ParseResult (Iterable< String > linkWords)
String getLanguage ()
void setLanguage (String language)
Map< String, WordgetWordCounts ()
int getMaxWordCount ()
int getMinWordCount ()
Adjacency getAdjacencyObj ()
void update ()
Map< String, LinkgetLinks ()
void add (String a, String linkWord, String b)
ParseResult filterStopWords () throws PNException
ParseResult filterStopWords (String language) throws PNException
ParseResult filterTop (int num)
ParseResult filterBlack (Collection< String > filter)
ParseResult filterWhite (Collection< String > filter)
String toString ()

Detailed Description

A parse result.


Constructor & Destructor Documentation

pn::parse::ParseResult::ParseResult ( Iterable< String >  linkWords) [inline]

Ctor.

Parameters:
linkWordsAll link words. Must not be null

Member Function Documentation

void pn::parse::ParseResult::add ( String  a,
String  linkWord,
String  b 
) [inline]

Adds a connection (A x B).

Parameters:
aA. Must not be null
linkWordThe link word. Must be known to this object (see ctor)
bB. Must not be null
ParseResult pn::parse::ParseResult::filterBlack ( Collection< String >  filter) [inline]

Returns a new parse result, removing all prases 'A x B' where A, B or both A and B are in the specified blacklist. This result remains unchanged.

Parameters:
filterThe words to remove. Must not be null
Returns:
The filtered result
ParseResult pn::parse::ParseResult::filterStopWords ( ) throws PNException [inline]

Returns a new parse result with all words removed that are known stopwords in the current language (see getLanguage()). This result remains unchanged.

Returns:
The filtered result
Exceptions:
PNExceptionIf the language is not specified or an error occures while loading the words
ParseResult pn::parse::ParseResult::filterStopWords ( String  language) throws PNException [inline]

Returns a new parse result with all words removed that are known stopwords in the specified language. This result remains unchanged.

Returns:
The filtered result
Exceptions:
PNExceptionIf an error occures while loading the words
ParseResult pn::parse::ParseResult::filterTop ( int  num) [inline]

Returns a a new parse result containing only prases 'A x B' where A, B or both A and B are amongst the num most frequently occuring words. This result remains unchanged.

Parameters:
numNumber of most frequent words to process
Returns:
The filtered result
ParseResult pn::parse::ParseResult::filterWhite ( Collection< String >  filter) [inline]

Returns a new parse result, keeping only phrases 'A x B' where A, B or both A and B are in the specified whitelist. This result remains unchanged.

Parameters:
filterThe words to keep. Must not be null
Returns:
The filtered result
Adjacency pn::parse::ParseResult::getAdjacencyObj ( ) [inline]

Returns the Adjacency object for this parse result. See pn.parse.ParseResult.Adjacency

Returns:
the adjacency object
String pn::parse::ParseResult::getLanguage ( ) [inline]
Returns:
The language of the words or null if unset
Map<String, Link> pn::parse::ParseResult::getLinks ( ) [inline]

Returns a map that contains all links (A x B).

Returns:
The links
int pn::parse::ParseResult::getMaxWordCount ( ) [inline]

Searches for the word with the maximal occurance in the parse result and returns the number of occurrences.

Returns:
the number of maximal occurrences
int pn::parse::ParseResult::getMinWordCount ( ) [inline]

Searches for the word with the lowest occurrences in the parse result and returns the number of occurrences.

Returns:
the number of minimal occurrences
Map<String, Word> pn::parse::ParseResult::getWordCounts ( ) [inline]

Returns a collection containing all words that occur in this parse result along with the number of occurences in a sorted (descending) list.

Returns:
All words
void pn::parse::ParseResult::setLanguage ( String  language) [inline]

Sets the language of the words

Parameters:
languageThe language
void pn::parse::ParseResult::update ( ) [inline]

Updates the result, calculating all words and their number of occurences.


The documentation for this class was generated from the following file:
 All Classes Functions Variables