update dev300-m58
[ooovba.git] / offapi / com / sun / star / linguistic2 / XLanguageGuessing.idl
blob8fb08b2f0837cd31f561c707d27b8b8fe785476d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XLanguageGuessing.idl,v $
10 * $Revision: 1.3 $
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>
36 #endif
37 #ifndef _COM_SUN_STAR_LANG_LOCALE_idl_
38 #include <com/sun/star/lang/Locale.idl>
39 #endif
40 #ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_IDL_
41 #include <com/sun/star/lang/IllegalArgumentException.idl>
42 #endif
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:
49 <ul>
50 <li>af : Afrikaans</li>
51 <li>am : Amharic</li>
52 <li>ar : Arabic</li>
53 <li>be : Belarus</li>
54 <li>br : Breton</li>
55 <li>bs : Bosnian</li>
56 <li>ca : Catalan</li>
57 <li>cs : Czech</li>
58 <li>cy : Welsh</li>
59 <li>da : Danish</li>
60 <li>de : German</li>
61 <li>drt : Drents</li>
62 <li>el : Greek</li>
63 <li>en : English</li>
64 <li>eo : Esperanto</li>
65 <li>es : Spanish</li>
66 <li>et : Estonian</li>
67 <li>eu : Basque</li>
68 <li>fa : Farsi</li>
69 <li>fi : Finnish</li>
70 <li>fr : French</li>
71 <li>fy : Frisian</li>
72 <li>ga : Irish Gaelic</li>
73 <li>gd : Scots Gaelic</li>
74 <li>gv : Manx Gaelic</li>
75 <li>he : Hebrew</li>
76 <li>hi : Hindi</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>
82 <li>it : Italian</li>
83 <li>ja : Japanese</li>
84 <li>ka : Georgian</li>
85 <li>ko : Korean</li>
86 <li>la : Latin</li>
87 <li>lt : Lithuanian</li>
88 <li>lv : Latvian</li>
89 <li>mr : Marathi</li>
90 <li>ms : Malay</li>
91 <li>ne : Nepali</li>
92 <li>nl : Dutch</li>
93 <li>nb : Norwegian (Bokmal)</li>
94 <li>pl : Polish</li>
95 <li>pt-PT : Portuguese (Portugal)</li>
96 <li>qu : Quechua</li>
97 <li>rm : Romansh</li>
98 <li>ro : Romanian</li>
99 <li>ru : Russian</li>
100 <li>sa : Sanskrit</li>
101 <li>sco : Scots</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>
108 <li>ta : Tamil</li>
109 <li>th : Thai</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>
117 </ul>
119 </p>
121 @since OOo 2.2
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
138 be arbitrary.</p>
140 @returns
141 the locale for the language identified.
142 If no language could be identified the locale will be empty.
144 @param aText
145 all the text including the part that should checked.
147 @param nStartPos
148 specifies the starting index of the sub-string to be checked
149 The value must met 0 <= nStartPos < (length of text - 1).
151 @param nLen
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(
158 [in] string aText,
159 [in] long nStartPos,
160 [in] long nLen )
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
175 disabled.
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();
203 }; }; }; };
205 #endif