
a list) and it not only contains the flow text but also other text content like text frames, headers and footers etc. If the word "paragraph" is used this will also denote an "FP", not a real paragraph in the document as not always both are the same.Īn FP is not necessarily a paragraph as in the documents context, it can be a collection of them (e.g. In the following we will call these objects "flat paragraph iterators" (FPIterator) and "flat paragraphs" (FP). The latter interface is derived from .XTextMarkup. Through this interface it must be able to provide objects implementing .XFlatParagraphIterator that themselves return objects implementing .XFlatParagraph. A document wanting to become checked for grammar errors must support the interface .XFlatParagraphIteratorProvider. It encapsulates the access to the text of the document. The first part comes from the document being checked and it is an implementation that is specific for the particular type of document (e.g.
struct 2.SingleGrammarErrorįor a description of the types and hints for how to implement them see Grammar Checking API. interface 2.XGrammarCheckingResultListener. interface .XFlatParagraphIteratorProvider. The whole process uses the following UNO types: About mixing languages in one sentence see below.Īll involved objects (except the thread object that is a C++ object derive from osl::Thread) communicate with each other through UNO interfaces. It is assumed that the grammar checking is done sentence by sentence and a single language can be assigned to each sentence (but each sentence may have a different one). 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. objects iterating through the text of a document, one object representing a single grammar checking task that was requested. one thread object per grammar checker that is used to perform the checking without blocking the GUI. a global grammar checking iterator (common to all documents) implemented as singleton, checking one sentence (of an arbitrary document) at a time. one context menu when clicking on text marked as incorrect. one or more grammar check dialogs (at most one instance per document). one or more grammar checker implementations, each supporting at least one language. 3.2 Grammar checking and spell checking at the same time. 3.1 Grammar checking of mixed language text. 3 Problems and questions currently left open. 2.4 Checking several documents at the same time and mixing all the above tasks. 2.3 Using the context menu with grammar checking.
2.2 Sample process of interactive grammar checking. 2.1 Sample process of automatic grammar checking.