1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XLanguageGuessing.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_linguistic2_XLanguageGuessing_idl__
32 #define __com_sun_star_linguistic2_XLanguageGuessing_idl__
34 #ifndef _COM_SUN_STAR_UNO_XINTERFACE_idl_
35 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef _COM_SUN_STAR_LANG_LOCALE_idl_
38 #include
<com
/sun
/star
/lang
/Locale.idl
>
40 #ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_IDL_
41 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
44 module com
{ module sun
{ module star
{ module linguistic2
{
46 /** This interface allows to guess the language of a text
48 <p> The current set of supported languages is:
50 <li>af : Afrikaans</li>
64 <li>eo : Esperanto</li>
66 <li>et : Estonian</li>
72 <li>ga : Irish Gaelic</li>
73 <li>gd : Scots Gaelic</li>
74 <li>gv : Manx Gaelic</li>
77 <li>hr : Croatian</li>
78 <li>hu : Hungarian</li>
79 <li>hy : Armenian</li>
80 <li>id : Indonesian</li>
81 <li>is : Icelandic</li>
83 <li>ja : Japanese</li>
84 <li>ka : Georgian</li>
87 <li>lt : Lithuanian</li>
93 <li>nb : Norwegian (Bokmal)</li>
95 <li>pt-PT : Portuguese (Portugal)</li>
98 <li>ro : Romanian</li>
100 <li>sa : Sanskrit</li>
102 <li>sh-YU : Serbian (written with latin characters)</li>
103 <li>sk-SK : Slovak (written with latin characters)</li>
104 <li>sl : Slovenian</li>
105 <li>sq : Albanian</li>
106 <li>sv : Swedish</li>
107 <li>sw : Swahili</li>
110 <li>tl : Tagalog</li>
111 <li>tr : Turkish</li>
112 <li>uk : Ukrainian</li>
113 <li>vi : Vietnamese</li>
114 <li>yi : Yiddish</li>
115 <li>zh-CN : Chinese (simplified)</li>
116 <li>zh-TW : Chinese (traditional)</li>
123 interface XLanguageGuessing
125 //-------------------------------------------------------------------------
126 /** determines the single most probable language of a sub-string.
128 <p>Please note that because statistical analysis is part
129 of the algorithm the the likelihood to get the correct
130 result increases with the length of the sub-string.
131 A word is much less likely guessed correctly compared to
132 a sentence or even a whole paragraph.</p>
134 <p>Also note that some languages are that 'close' to each other
135 that it will be quite unlikely to find a difference in them,
136 e.g. English (UK), English (IE) and English (AUS) and
137 most liklely English (US) as well. And thus the result may
141 the locale for the language identified.
142 If no language could be identified the locale will be empty.
145 all the text including the part that should checked.
148 specifies the starting index of the sub-string to be checked
149 The value must met 0 <= nStartPos < (length of text - 1).
152 specifies the length of the sub-string to be checked.
153 The value must met 0 <= nLen <= (length of text).
155 @see <type scope="com::sun::star::lang">Locale</type>
157 com
::sun
::star
::lang
::Locale guessPrimaryLanguage
(
161 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
163 //-------------------------------------------------------------------------
164 /** allows to explicitly discard some languages from the set of
165 languages possibly returned.
167 <p>By default all languages are enabled.</p>
169 void disableLanguages
(
170 [in] sequence
< com
::sun
::star
::lang
::Locale
> aLanguages
)
171 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
173 //-------------------------------------------------------------------------
174 /** allows to explicitly re-enable some languages that got previously
177 <p>By default all languages are enabled.</p>
179 void enableLanguages
(
180 [in] sequence
< com
::sun
::star
::lang
::Locale
> aLanguages
)
181 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
183 //-------------------------------------------------------------------------
184 /** returns a list of all supported languages.
186 <p>This should be the same as the mathematical union of
187 all enabled and disabled languages.</p>
189 sequence
< com
::sun
::star
::lang
::Locale
> getAvailableLanguages
();
191 //-------------------------------------------------------------------------
192 /** returns the list of all enabled languages
194 sequence
< com
::sun
::star
::lang
::Locale
> getEnabledLanguages
();
196 //-------------------------------------------------------------------------
197 /** returns the list of all disabled languages
199 sequence
< com
::sun
::star
::lang
::Locale
> getDisabledLanguages
();