csli.dialog.app.calo.parse
Class Phrase

java.lang.Object
  extended by csli.dialog.app.calo.parse.Phrase
All Implemented Interfaces:
Serializable

public class Phrase
extends Object
implements Serializable

represents the syntactic and semantic features of a phrase found by the Gemini parser. Includes semantic logical form and parse features.

Author:
jdowding
See Also:
Serialized Form

Field Summary
 LFTerm LF
           
 String rule
           
 double score
           
 long segment
           
 String wcn
           
 Term yield
           
 
Constructor Summary
Phrase()
           
Phrase(double Score, long Segment, String Rule, String Yield, String LF, String wcn)
          Creates a Phrase with initial values for the Score, Segment, Rule, Yield, and LF fields
 
Method Summary
 long getAcousticLengthFeature()
          returns the number of words in this phrase (in the yield)
 double getAcousticProbabilityFeature()
          returns the acoustic probability (as a log probability from 0 - negative infinity) Acoustic probabilities are provided by Decipher, and derived directly from the WCN
 String getAgentNounClassFeature()
          returns the semantic class for the entity filling the agent thematic role, if any Semantic classes are derived from WordNet synsets
 long getEndIndexFeature()
          returns the index for the end point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll").
 double getEndPercentageFeature()
          returns the end point of the phrase, expressed as a percentage.
 String getId()
           
 LFTerm getLF()
           
 Map<String,Object> getMap()
           
 String getNounClassFeature()
          returns the semantic class of the head noun for NP and PP phrases Semantic classes are aligned to the corresponding WordNet synsets.
 String getNounFeature()
          returns the head noun for this NP or PP phrase.
 long getNumFilledRolesFeature()
          returns the number of thematic roles that are filled in the logical form for this phrase.
 double getParseProbabilityFeature()
          returns the parseProbability assigned by Gemini.
 String getPassiveFeature()
          returns "yes" if the this sentence is in the passive voice
 String getPhraseTypeFeature()
          returns the phrase type of this phrase, one of s, np, vp, pp
 String getRule()
           
 double getScore()
          Deprecated. replaced by getAcousticProbabilityFeature()
 long getSegment()
           
 double getSegmentShortFallFeature()
          returns the segmentShortFall segmentShortFall is the difference between the acoustic score for this phrase, and the score assigned to the one-best path in the WCN between the same indicies.
 long getStartIndexFeature()
          sets the index for the start point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll").
 double getStartPercentageFeature()
          returns the start point of the phrase, expressed as a percentage.
 String getTenseFeature()
          return the tense of the phrase, for S and VP phrases, one of past, present, or future.
 String getVerbClassFeature()
          returns the verb class for main verb of this phrase, if any.
 String getVerbFeature()
          returns the base form of the main verb for this phrase, if any
 String getWcn()
           
 Term getYield()
          Deprecated. replaced by getYieldFeature()
 String getYieldFeature()
          returns the yield of the phrase, as a String
 boolean isNominalizationFeature()
          returns true if the the head noun in this noun phrase expresses an event.
 boolean isPerfectFeature()
          returns true if this phrase has perfect aspect.
 boolean isProgressiveFeature()
          returns true if this phrase has progressive aspect.
 void setAcousticLengthFeature(long acousticLengthFeature)
          sets the number of words in this phrase
 void setAcousticProbabilityFeature(double acousticProbabilityFeature)
          sets the acoustic probability (as a log probability from 0 - negative infinity) Acoustic probabilities are provided by Decipher, and derived directly from the WCN
 void setAgentNounClassFeature(String agentNounClassFeature)
          sets the semantic class for the entity filling the agent thematic role, if any Semantic classes are derived from WordNet synsets
 void setEndIndexFeature(long endIndexFeature)
          sets the index for the end point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll").
 void setEndPercentageFeature(double endPercentageFeature)
          sets the end point of the phrase, expressed as a percentage.
 void setLF(LFTerm lf)
           
 void setNominalizationFeature(boolean nominalizationFeature)
          set to true if the head noun in this noun phrase expresses an event.
 void setNounClassFeature(String nounClassFeature)
          sets the semantic class of the head noun for NP and PP phrases Semantic classes are aligned to the corresponding WordNet synsets.
 void setNounFeature(String nounFeature)
          sets the head noun for this NP or PP phrase
 void setNumFilledRolesFeature(long numFilledRolesFeature)
          sets the number of thematic roles that are filled in the logical form for this phrase
 void setParseProbabilityFeature(double parseProbabilityFeature)
          sets the parseProbability parseProbabilites are expressed as log probabilities from 0 to negative infinity.
 void setPassiveFeature(String passiveFeature)
          set to "yes" if this sentence is in the passive voice
 void setPerfectFeature(boolean perfectFeature)
          set to true if this phrase has perfect aspect.
 void setPhraseTypeFeature(String phraseTypeFeature)
          sets the phrase type of this phrase, one of s, np, vp, pp
 void setProgressiveFeature(boolean progressiveFeature)
          set to true if this phrase has progressive aspect.
 void setRule(String rule)
           
 void setScore(double score)
          Deprecated. replaced by setAcousticProbabilityFeature(double)
 void setSegment(long segment)
           
 void setSegmentShortFallFeature(double segmentShortFallFeature)
          sets the segmentShortFall segmentShortFall is the difference between the acoustic score for this phrase, and the score assigned to the one-best path in the WCN between the same indicies.
 void setStartIndexFeature(long startIndexFeature)
          sets the index for the start point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll").
 void setStartPercentageFeature(double startPercentageFeature)
          sets the start point of the phrase, expressed as a percentage.
 void setTenseFeature(String tenseFeature)
          set the tense of the phrase, for S and VP phrasees, one of past, present, or future
 void setVerbClassFeature(String verbClassFeature)
          sets the verb class for main verb of this phrase, if any.
 void setVerbFeature(String verbFeature)
          set to the base form of the main verb for this phrase, if any
 void setWcn(String wcn)
           
 void setYield(Term yield)
          Deprecated. replaced by setYieldFeature(String)
 void setYieldFeature(String yieldFeature)
          set to the yield of the phrase, as a String
 String toPrologString()
          Generates a String encoding of key elements of this Phrase as a Prolog Term
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

score

public double score

segment

public long segment

rule

public String rule

yield

public Term yield

LF

public LFTerm LF

wcn

public String wcn
Constructor Detail

Phrase

public Phrase(double Score,
              long Segment,
              String Rule,
              String Yield,
              String LF,
              String wcn)
Creates a Phrase with initial values for the Score, Segment, Rule, Yield, and LF fields

Parameters:
Score - - the acoustic probability (log prob) assigned by Decipher for this phrase
Segment - - an encoding of the span (from-to) of this phrase
Rule - - the name of the syntactic rule for the top-level non-terminal of this phrase
Yield - - the word string that makes up this phrase
LF - - the full Logical Form for this phrase
wcn - - the wcn

Phrase

public Phrase()
Method Detail

getScore

public double getScore()
Deprecated. replaced by getAcousticProbabilityFeature()

Returns:

setScore

public void setScore(double score)
Deprecated. replaced by setAcousticProbabilityFeature(double)

Parameters:
score - The score to set.

getSegment

public long getSegment()
Returns:
Returns the segment.

setSegment

public void setSegment(long segment)
Parameters:
segment - The segment to set.

getRule

public String getRule()
Returns:
Returns the rule.

setRule

public void setRule(String rule)
Parameters:
rule - The rule to set.

getYield

public Term getYield()
Deprecated. replaced by getYieldFeature()

returns the yield for this phrase

Returns:

setYield

public void setYield(Term yield)
Deprecated. replaced by setYieldFeature(String)

Parameters:
yield - The yield to set.

getLF

public LFTerm getLF()
Returns:
the Logical Form for this phrase, as an LFTerm object

setLF

public void setLF(LFTerm lf)
Parameters:
lf - The LogicalForm to set.

getWcn

public String getWcn()
Returns:
Returns the wcn.

setWcn

public void setWcn(String wcn)
Parameters:
wcn - The wcn to set.

toPrologString

public String toPrologString()
Generates a String encoding of key elements of this Phrase as a Prolog Term

Returns:

toString

public String toString()
Overrides:
toString in class Object

getId

public String getId()

getAcousticLengthFeature

public long getAcousticLengthFeature()
returns the number of words in this phrase (in the yield)

Returns:
Returns the acousticLengthFeature.

setAcousticLengthFeature

public void setAcousticLengthFeature(long acousticLengthFeature)
sets the number of words in this phrase

Parameters:
acousticLengthFeature - The acousticLengthFeature to set.

getAcousticProbabilityFeature

public double getAcousticProbabilityFeature()
returns the acoustic probability (as a log probability from 0 - negative infinity) Acoustic probabilities are provided by Decipher, and derived directly from the WCN

Returns:
Returns the acousticProbabilityFeature.

setAcousticProbabilityFeature

public void setAcousticProbabilityFeature(double acousticProbabilityFeature)
sets the acoustic probability (as a log probability from 0 - negative infinity) Acoustic probabilities are provided by Decipher, and derived directly from the WCN

Parameters:
acousticProbabilityFeature - The acousticProbabilityFeature to set.

getAgentNounClassFeature

public String getAgentNounClassFeature()
returns the semantic class for the entity filling the agent thematic role, if any Semantic classes are derived from WordNet synsets

Returns:
Returns the agentNounClassFeature.

setAgentNounClassFeature

public void setAgentNounClassFeature(String agentNounClassFeature)
sets the semantic class for the entity filling the agent thematic role, if any Semantic classes are derived from WordNet synsets

Parameters:
agentNounClassFeature - The agentNounClassFeature to set.

getEndIndexFeature

public long getEndIndexFeature()
returns the index for the end point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll"). Index i in the original WCN will generate indicies 2i and 2i+1 in the Gemini graph.

Returns:
Returns the endIndexFeature.

setEndIndexFeature

public void setEndIndexFeature(long endIndexFeature)
sets the index for the end point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll"). Index i in the original WCN will generate indicies 2i and 2i+1 in the Gemini graph.

Parameters:
endIndexFeature - The endIndexFeature to set.

getEndPercentageFeature

public double getEndPercentageFeature()
returns the end point of the phrase, expressed as a percentage. endPercentageFeature = 100 *(endIndexFeature / FinalIndex)

Returns:
Returns the endPercentageFeature.

setEndPercentageFeature

public void setEndPercentageFeature(double endPercentageFeature)
sets the end point of the phrase, expressed as a percentage. endPercentageFeature = 100 *(endIndexFeature / FinalIndex)

Parameters:
endPercentageFeature - The endPercentageFeature to set.

isNominalizationFeature

public boolean isNominalizationFeature()
returns true if the the head noun in this noun phrase expresses an event.

Returns:
Returns the nominalizationFeature.

setNominalizationFeature

public void setNominalizationFeature(boolean nominalizationFeature)
set to true if the head noun in this noun phrase expresses an event.

Parameters:
nominalizationFeature - The nominalizationFeature to set.

getNounClassFeature

public String getNounClassFeature()
returns the semantic class of the head noun for NP and PP phrases Semantic classes are aligned to the corresponding WordNet synsets.

Returns:
Returns the nounClassFeature.

setNounClassFeature

public void setNounClassFeature(String nounClassFeature)
sets the semantic class of the head noun for NP and PP phrases Semantic classes are aligned to the corresponding WordNet synsets.

Parameters:
nounClassFeature - The nounClassFeature to set.

getNounFeature

public String getNounFeature()
returns the head noun for this NP or PP phrase.

Returns:
Returns the nounFeature.

setNounFeature

public void setNounFeature(String nounFeature)
sets the head noun for this NP or PP phrase

Parameters:
nounFeature - The nounFeature to set.

getNumFilledRolesFeature

public long getNumFilledRolesFeature()
returns the number of thematic roles that are filled in the logical form for this phrase.

Returns:
Returns the numFilledRolesFeature.

setNumFilledRolesFeature

public void setNumFilledRolesFeature(long numFilledRolesFeature)
sets the number of thematic roles that are filled in the logical form for this phrase

Parameters:
numFilledRolesFeature - The numFilledRolesFeature to set.

getParseProbabilityFeature

public double getParseProbabilityFeature()
returns the parseProbability assigned by Gemini. parseProbabilites are expressed as log probabilities from 0 to negative infinity.

Returns:
Returns the parseProbabilityFeature.

setParseProbabilityFeature

public void setParseProbabilityFeature(double parseProbabilityFeature)
sets the parseProbability parseProbabilites are expressed as log probabilities from 0 to negative infinity.

Parameters:
parseProbabilityFeature - The parseProbabilityFeature to set.

getPassiveFeature

public String getPassiveFeature()
returns "yes" if the this sentence is in the passive voice

Returns:
Returns the passiveFeature.

setPassiveFeature

public void setPassiveFeature(String passiveFeature)
set to "yes" if this sentence is in the passive voice

Parameters:
passiveFeature - The passiveFeature to set.

isPerfectFeature

public boolean isPerfectFeature()
returns true if this phrase has perfect aspect.

Returns:
Returns the perfectFeature.

setPerfectFeature

public void setPerfectFeature(boolean perfectFeature)
set to true if this phrase has perfect aspect.

Parameters:
perfectFeature - The perfectFeature to set.

getPhraseTypeFeature

public String getPhraseTypeFeature()
returns the phrase type of this phrase, one of s, np, vp, pp

Returns:
Returns the phraseTypeFeature.

setPhraseTypeFeature

public void setPhraseTypeFeature(String phraseTypeFeature)
sets the phrase type of this phrase, one of s, np, vp, pp

Parameters:
phraseTypeFeature - The phraseTypeFeature to set.

isProgressiveFeature

public boolean isProgressiveFeature()
returns true if this phrase has progressive aspect.

Returns:
Returns the progressiveFeature.

setProgressiveFeature

public void setProgressiveFeature(boolean progressiveFeature)
set to true if this phrase has progressive aspect.

Parameters:
progressiveFeature - The progressiveFeature to set.

getSegmentShortFallFeature

public double getSegmentShortFallFeature()
returns the segmentShortFall segmentShortFall is the difference between the acoustic score for this phrase, and the score assigned to the one-best path in the WCN between the same indicies. Intuitively, this is a measure of how far down in the WCN this phrase was found. Although acoustic probabilies are expressed as log probabilities, the segmentShortFall is defined as BestPathScore - ThisPathScore, and is always a positive double >= 0.

Returns:
Returns the segmentShortFallFeature.

setSegmentShortFallFeature

public void setSegmentShortFallFeature(double segmentShortFallFeature)
sets the segmentShortFall segmentShortFall is the difference between the acoustic score for this phrase, and the score assigned to the one-best path in the WCN between the same indicies. Intuitively, this is a measure of how far down in the WCN this phrase was found. Although acoustic probabilies are expressed as log probabilities, the segmentShortFall is defined as BestPathScore - ThisPathScore, and is always a positive double >= 0.

Parameters:
segmentShortFallFeature - The segmentShortFallFeature to set.

getStartIndexFeature

public long getStartIndexFeature()
sets the index for the start point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll"). Index i in the original WCN will generate indicies 2i and 2i+1 in the Gemini graph.

Returns:
Returns the startIndexFeature.

setStartIndexFeature

public void setStartIndexFeature(long startIndexFeature)
sets the index for the start point of this phrase Indicies are related to indicies in the original WCN, but additional indicies are inserted to allow for contracted forms ("i'll" gets split into "i" and "'ll"). Index i in the original WCN will generate indicies 2i and 2i+1 in the Gemini graph.

Parameters:
startIndexFeature - The startIndexFeature to set.

getStartPercentageFeature

public double getStartPercentageFeature()
returns the start point of the phrase, expressed as a percentage. startPercentageFeature = 100 *(startIndexFeature / FinalIndex)

Returns:
Returns the startPercentageFeature.

setStartPercentageFeature

public void setStartPercentageFeature(double startPercentageFeature)
sets the start point of the phrase, expressed as a percentage. startPercentageFeature = 100 *(startIndexFeature / FinalIndex)

Parameters:
startPercentageFeature - The startPercentageFeature to set.

getTenseFeature

public String getTenseFeature()
return the tense of the phrase, for S and VP phrases, one of past, present, or future.

Returns:
Returns the tenseFeature.

setTenseFeature

public void setTenseFeature(String tenseFeature)
set the tense of the phrase, for S and VP phrasees, one of past, present, or future

Parameters:
tenseFeature - The tenseFeature to set.

getVerbClassFeature

public String getVerbClassFeature()
returns the verb class for main verb of this phrase, if any. Verb classes are derived from the VerbNet verb hierarchy.

Returns:
Returns the verbClassFeature.

setVerbClassFeature

public void setVerbClassFeature(String verbClassFeature)
sets the verb class for main verb of this phrase, if any. Verb classes are derived from the VerbNet verb hierarchy.

Parameters:
verbClassFeature - The verbClassFeature to set.

getVerbFeature

public String getVerbFeature()
returns the base form of the main verb for this phrase, if any

Returns:
Returns the verbFeature.

setVerbFeature

public void setVerbFeature(String verbFeature)
set to the base form of the main verb for this phrase, if any

Parameters:
verbFeature - The verbFeature to set.

getYieldFeature

public String getYieldFeature()
returns the yield of the phrase, as a String

Returns:
Returns the yieldFeature.

setYieldFeature

public void setYieldFeature(String yieldFeature)
set to the yield of the phrase, as a String

Parameters:
yieldFeature - The yieldFeature to set.

getMap

public Map<String,Object> getMap()