cz.cuni.mff.procasor.treeAnalyser
Interface TreeAnalyser

All Known Implementing Classes:
ClassicTreeAnalyser

public interface 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. Implementations of this interface may use different rules and tools for the analysis.

Analysis methods return a new Semantics object. This object contains the detected type of step, words of the sentence with their detected roles and additional optional information. Posible step types and what can you expect to be in the semantics follows.

REQUEST_RECEIVED:
Subject refers to an actor, different from SuD. Its name in the sentence will be marked as SUBJECT. Main verb is marked as VERB, representative object words as REPRESENTATIVE_OBJECT, others as NOT_IMPORTANT.

REQUEST_SENT:
Subject refers to SuD (marked as SUBJECT), indirect object refers to an actor and its name is marked as INDIRECT_OBJECT. Main verb is marked as VERB, representative object words as REPRESENTATIVE_OBJECT, others as NOT_IMPORTANT.

INTERNAL_ACTION:
Subject refers to SuD (marked as SUBJECT). Main verb is marked as VERB, representative object words as REPRESENTATIVE_OBJECT, others as NOT_IMPORTANT.

GOTO:
Verb is marked as VERB, target step label is marked as GOTO_TARGET.

ABORT:
Verb (abort) is marked as VERB, subject (use case) is marked as SUBJECT, if present.

TERMINATE_USECASE:
Verb (end, terminate) is marked as VERB, subject (use case) is marked as SUBJECT, if present.

TERMINATE_BRANCH:
Verb (end, terminate) is marked as VERB, subject (extension, variation) is marked as SUBJECT.

CONDITION:
Important words are marked as CONDITION_LABEL.
In future, there may be another possibility (in addition) as follows: Subject is set, and refers to actor that triggers the condition. Its name in the sentence is marked as SUBJECT. Main verb is marked as verb, and for condition token it should be turned into passive voice. Other important words are marked as CONDITION_LABEL.

Author:
michal

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.
 

Method Detail

setProject

public void setProject(Project p)
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.

Parameters:
p - the project to be set

setUseCase

public void setUseCase(UseCase uc)
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.

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
Analyses the given parse tree as a use case step.

Parameters:
parseTree - Parse tree of the sentence 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

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
Analyses the given parse tree as a condition.

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
Creates a Semantics object for the sentence. Does not perform any analysis, only copies information from the given parse tree.

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