1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Frank Yung-Fong Tang <ftang@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include
"nsISupports.idl"
42 // {ADF42751-1CEF-4ad2-AA8E-BCB849D8D31F}
43 #define NS_SEMANTICUNITSCANNER_CID
{ 0xadf42751, 0x1cef, 0x4ad2, { 0xaa, 0x8e, 0xbc, 0xb8, 0x49, 0xd8, 0xd3, 0x1f}}
44 #define NS_SEMANTICUNITSCANNER_CONTRACTID
"@mozilla.org/intl/semanticunitscanner;1"
48 * Provides a language independent way to break UNICODE
49 * text into meaningful semantic units (e.g. words).
51 [scriptable
, uuid(9f620be4
-e535
-11d6
-b254
-00039310a47a
)]
52 interface nsISemanticUnitScanner
: nsISupports
{
56 * Starts up the semantic unit scanner with an optional
57 * character set, which acts as a hint to optimize the heuristics
58 * used to determine the language(s) of the processed text.
60 * @param characterSet the character set the text was originally
61 * encoded in (can be NULL)
63 void start
(in string characterSet
);
67 * Get the begin / end offset of the next unit in the current text
69 * @param text the text to be scanned
70 * @param length the number of characters in the text to be processed
71 * @param pos the current position
72 * @param isLastBuffer, the buffer is the last one
73 * @param begin the begin offset of the next unit
74 * @param begin the end offset of the next unit
75 * @return has more unit in the current text
77 boolean next
(in wstring text
, in long length
, in long pos
,
78 in boolean isLastBuffer
,
79 out long begin
, out long end
);