Fido Alpha 3.2

Class Ellipsis


public class Ellipsis
extends java.lang.Object

Ellipsis takes missing parts of the current fragment and fills in parts from the previous sentence. Also, ellipsis takes care of verb ellipsis, like in the sentences:

  1. Jack forgot his wallet
  2. Sam did too.
The Ellipsis module will use the previous sentence structure, stored in the Discourse class. It will take the sentence structures and attempt to find patterns with the previous sentence structure. If there is a pattern, the previous sentence structure will be merged with the current to form a complete command. If no pattern is found, it is an error condition because the current command is a fragment, which cannot be processed.

The system will keep track of when the previous response to the user was a question. If so, the noun phrase is most likely an answer to the question, and not an ellipsis.

Previously, the new sentence structure has been saved to Discourse class in the Discourse Resolver module.

See the Ellipsis Concepts page for more information.

See Also:
Discourse, DiscourseResolver

Constructor Summary
Ellipsis(Discourse discourse)
          Creates a new Ellipsis instance.
Method Summary
 Sentence analyze(Fragment fragment)
          Converts a Fragment to a full Sentence by using parts of the previous input stored in the Discourse class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Ellipsis(Discourse discourse)
Creates a new Ellipsis instance.

discourse - Discourse object used in resolving nouns
Method Detail


public Sentence analyze(Fragment fragment)
                 throws FidoDatabaseException,
Converts a Fragment to a full Sentence by using parts of the previous input stored in the Discourse class.


  1. There are two types of Ellipsis: a noun phrase and a prepositional phrase.
  2. Noun Phrase Ellipsis - the noun phrase in the fragment is compared to the subject, indirect object, predicate noun, and all nouns as prepositional nouns.
  3. Prepositional Phrase Ellipsis - the noun phrase in the fragment is compared to all the nouns as prepositional nouns.
  4. If either of the above two replace a noun in the previous sentence:
    • copy the old sentence structure to a new sentence structure
    • replace the NounPhrase in the previous sentence with the new NounPhrase in the copied structure
    • replace the current structure with the copied structure
    • leave the previous structure for testing with the next sentence
    • exit the Ellipsis module
  5. If the previous sentence was not a question, and the current sentence is a fragment, this module should perform some action. If all NounPhrases are analyzed and no structures are similar, it is an error condition.

fragment - Sentence fragment
Fully filled out Sentence class
FidoDatabaseException - Thrown if there is an error contacting or processing a database request.
ObjectNotFoundException - Thrown if an object id one of the ResolvedNoun classes is not found. This should never happen.
NoEllipsisMatchException - Thrown if a NounPhrase in the previous input was not found to replace the current.
MultipleEllipsisMatchException - Thrown if there are multiple NounPhrase in the previous input that replace the current.
See Also:

Fido Alpha 3.2