Grammar Checking

From Apache OpenOffice Wiki
Revision as of 14:12, 26 September 2007 by Mba (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Grammar checking is seen as a particular implementation of a text iteration and markup process, other iteration/markup processes like spell checking or smart tagging basically can work in the same way (though currently they are not implemented like this). If grammar checking is mentioned in the following documentation this can be seen as a placeholder for the more general task of text markup.

Involved objects

  • one or more documents to be checked
  • one or more grammar checker implementations, each supporting at least one language.
  • one or more grammar check dialogs (at most one per document)
  • one context menu when clicking on text marked as incorrect
  • a global grammar checking iterator (common to all documents) implemented as singleton, checking one sentence (of an arbitrary document) at a time.
  • one thread object per grammar checker that is used to perform checking in the background
  • objects iterating through the text of a document, one object representing a single grammar checking task that was requested
  • objects representing text blocks in a text document (“flat paragraphs”) that abstract from the concrete structure of the document and provide access to the text by simple text strings and integer values describing positions and lengths of sub string.

Required tasks:

  • Automatic grammar checking
  • Interactive grammar checking via dialog
  • Interactive grammar checking via context menu

Overview of the basic interfaces required

  • com.sun.star.text.XFlatParagraph implemented by a FlatParagraph object (FP)
  • com.sun.star.text.XFlatParagraphIterator implemented by the model of the document to check
  • com.sun.star.linguistic2.XGrammarChecker implemented by all grammar checker components
  • com.sun.star.linguistic2.XGrammarCheckingIterator implemented by the service css.linguistic2.GrammarCheckingIterator
  • com.sun.star.linguistic2.XGrammarCheckingResultListener
  • com.sun.star.linguistic2.XGrammarCheckingListener
Personal tools