cz.cuni.mff.procasor.treeAnalyser
Class ClassicTreeAnalyser

java.lang.Object
  extended bycz.cuni.mff.procasor.treeAnalyser.ClassicTreeAnalyser
All Implemented Interfaces:
TreeAnalyser

public class ClassicTreeAnalyser
extends java.lang.Object
implements TreeAnalyser

Tree analyser can analyse a parse tree and resolute the importance and role of single words, detect role of the actors in this sentence and detect the action type of the sentence.

This analysis uses output from linguistic tools and XPath querying. For this analysis, Classic tree analyser uses rules stated by V. Mencl in his work.

Same rules as stated in TreeAnalyser apply for the content of the returned Semantics object.

Author:
michal

Constructor Summary
ClassicTreeAnalyser()
          Creates an Analyser
 
Method Summary
 Semantics analyseCondition(java.lang.String parseTree)
          Analyses the given parse tree as a condition.
 Semantics analyseStep(java.lang.String parseTree)
          Analyses the given parse tree as a use case step.
 Semantics minimalSemantics(java.lang.String parseTree)
          Creates a Semantics object for the sentence.
 void setProject(Project p)
          Sets active project.
 void setUseCase(UseCase uc)
          Sets active use case, that will be used to gather actor information from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassicTreeAnalyser

public ClassicTreeAnalyser()
                    throws cz.cuni.mff.procasor.treeAnalyser.AnalyserNotReadyException
Creates an Analyser

Throws:
cz.cuni.mff.procasor.treeAnalyser.AnalyserNotReadyException - only in some weird unknown situation
Method Detail

setProject

public void setProject(Project p)
Description copied from interface: TreeAnalyser
Sets active project. You have to do this before running tree analysis. Project is used to gather conceptual object names for representative object detection, and entity names for suggestions, if analysis fails.

Specified by:
setProject in interface TreeAnalyser
Parameters:
p - the project to be set

setUseCase

public void setUseCase(UseCase uc)
Description copied from interface: TreeAnalyser
Sets active use case, that will be used to gather actor information from. You have to do this before running tree analysis. Actor and SuD information is gathered from the use case.

Specified by:
setUseCase in interface TreeAnalyser
Parameters:
uc - the use case to be set

analyseStep

public Semantics analyseStep(java.lang.String parseTree)
                      throws cz.cuni.mff.procasor.treeAnalyser.InvalidParseTreeException,
                             cz.cuni.mff.procasor.treeAnalyser.AnalyserNotReadyException,
                             cz.cuni.mff.procasor.treeAnalyser.AnalysisFailedException
Description copied from interface: TreeAnalyser
Analyses the given parse tree as a use case step.

Specified by:
analyseStep in interface TreeAnalyser
Parameters:
parseTree - Parse tree of the sentence to analyse
Returns:
semantics derived from the parse tree
Throws:
cz.cuni.mff.procasor.treeAnalyser.AnalyserNotReadyException - when use case or project information wasn't supplied
cz.cuni.mff.procasor.treeAnalyser.AnalysisFailedException - when tree analysis is not successful
cz.cuni.mff.procasor.treeAnalyser.InvalidParseTreeException - when supplied parse tree is not valid

analyseCondition

public Semantics analyseCondition(java.lang.String parseTree)
                           throws cz.cuni.mff.procasor.treeAnalyser.InvalidParseTreeException,
                                  cz.cuni.mff.procasor.treeAnalyser.AnalyserNotReadyException,
                                  cz.cuni.mff.procasor.treeAnalyser.AnalysisFailedException
Description copied from interface: TreeAnalyser
Analyses the given parse tree as a condition.

Specified by:
analyseCondition in interface TreeAnalyser
Parameters:
parseTree - Parse tree of the sentence/fragment to analyse
Returns:
semantics derived from the parse tree
Throws:
cz.cuni.mff.procasor.treeAnalyser.InvalidParseTreeException - when supplied parse tree is not valid
cz.cuni.mff.procasor.treeAnalyser.AnalyserNotReadyException - when use case or project information wasn't supplied
cz.cuni.mff.procasor.treeAnalyser.AnalysisFailedException - when tree analysis is not successful

minimalSemantics

public Semantics minimalSemantics(java.lang.String parseTree)
                           throws cz.cuni.mff.procasor.treeAnalyser.InvalidParseTreeException
Description copied from interface: TreeAnalyser
Creates a Semantics object for the sentence. Does not perform any analysis, only copies information from the given parse tree.

Specified by:
minimalSemantics in interface TreeAnalyser
Parameters:
parseTree - Parse tree of the sentence
Returns:
semantics derived from the parse tree
Throws:
cz.cuni.mff.procasor.treeAnalyser.InvalidParseTreeException - when supplied parse tree is not valid