michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: %{C++ michael@0: // {ADF42751-1CEF-4ad2-AA8E-BCB849D8D31F} michael@0: #define NS_SEMANTICUNITSCANNER_CID { 0xadf42751, 0x1cef, 0x4ad2, { 0xaa, 0x8e, 0xbc, 0xb8, 0x49, 0xd8, 0xd3, 0x1f}} michael@0: #define NS_SEMANTICUNITSCANNER_CONTRACTID "@mozilla.org/intl/semanticunitscanner;1" michael@0: %} michael@0: michael@0: /** michael@0: * Provides a language independent way to break UNICODE michael@0: * text into meaningful semantic units (e.g. words). michael@0: */ michael@0: [scriptable, uuid(9f620be4-e535-11d6-b254-00039310a47a)] michael@0: interface nsISemanticUnitScanner : nsISupports { michael@0: /** michael@0: * start() michael@0: * michael@0: * Starts up the semantic unit scanner with an optional michael@0: * character set, which acts as a hint to optimize the heuristics michael@0: * used to determine the language(s) of the processed text. michael@0: * michael@0: * @param characterSet the character set the text was originally michael@0: * encoded in (can be NULL) michael@0: */ michael@0: void start(in string characterSet); michael@0: michael@0: /** michael@0: * next() michael@0: * Get the begin / end offset of the next unit in the current text michael@0: * michael@0: * @param text the text to be scanned michael@0: * @param length the number of characters in the text to be processed michael@0: * @param pos the current position michael@0: * @param isLastBuffer, the buffer is the last one michael@0: * @param begin the begin offset of the next unit michael@0: * @param begin the end offset of the next unit michael@0: * @return has more unit in the current text michael@0: */ michael@0: boolean next(in wstring text, in long length, in long pos, michael@0: in boolean isLastBuffer, michael@0: out long begin, out long end ); michael@0: michael@0: };