author Wes Kocher <>
Wed, 29 Jan 2014 15:30:42 -0800
changeset 176108 095aa30cb6ef6a6772808db30e4ec3685a2d7d76
parent 98983 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Backed out changeset 82bc631a9e53 (bug 950240) a=backout CLOSED TREE

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */

#include "nsISupports.idl"

// {ADF42751-1CEF-4ad2-AA8E-BCB849D8D31F}
#define NS_SEMANTICUNITSCANNER_CID { 0xadf42751, 0x1cef, 0x4ad2, { 0xaa, 0x8e, 0xbc, 0xb8, 0x49, 0xd8, 0xd3, 0x1f}}

 * Provides a language independent way to break UNICODE
 * text into meaningful semantic units (e.g. words).
[scriptable, uuid(9f620be4-e535-11d6-b254-00039310a47a)]
interface nsISemanticUnitScanner : nsISupports {
     * start()
     * Starts up the semantic unit scanner with an optional
     * character set, which acts as a hint to optimize the heuristics
     * used to determine the language(s) of the processed text.
     * @param characterSet the character set the text was originally
     *                     encoded in (can be NULL)
    void start(in string characterSet);

     * next()
     * Get the begin / end offset of the next unit in the current text
     * @param text the text to be scanned
     * @param length the number of characters in the text to be processed
     * @param pos the current position
     * @param isLastBuffer, the buffer is the last one
     * @param begin the begin offset of the next unit 
     * @param begin the end offset of the next unit 
     * @return has more unit in the current text
    boolean next(in wstring text, in long length, in long pos, 
              in boolean isLastBuffer,
              out long begin, out long end );