Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / linguistic2 / XLanguageGuessing.idl
blob5408ab07666a62a66037f76df3f473efac52f3c9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_linguistic2_XLanguageGuessing_idl__
21 #define __com_sun_star_linguistic2_XLanguageGuessing_idl__
23 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/lang/Locale.idl>
25 #include <com/sun/star/lang/IllegalArgumentException.idl>
27 module com { module sun { module star { module linguistic2 {
29 /** This interface allows to guess the language of a text
31 <p> The current set of supported languages is:
32 <ul>
33 <li>af : Afrikaans</li>
34 <li>am : Amharic</li>
35 <li>ar : Arabic</li>
36 <li>be : Belarus</li>
37 <li>br : Breton</li>
38 <li>bs : Bosnian</li>
39 <li>ca : Catalan</li>
40 <li>cs : Czech</li>
41 <li>cy : Welsh</li>
42 <li>da : Danish</li>
43 <li>de : German</li>
44 <li>drt : Drents</li>
45 <li>el : Greek</li>
46 <li>en : English</li>
47 <li>eo : Esperanto</li>
48 <li>es : Spanish</li>
49 <li>et : Estonian</li>
50 <li>eu : Basque</li>
51 <li>fa : Persian</li>
52 <li>fi : Finnish</li>
53 <li>fr : French</li>
54 <li>fy : Frisian</li>
55 <li>ga : Irish Gaelic</li>
56 <li>gd : Scots Gaelic</li>
57 <li>gv : Manx Gaelic</li>
58 <li>he : Hebrew</li>
59 <li>hi : Hindi</li>
60 <li>hr : Croatian</li>
61 <li>hu : Hungarian</li>
62 <li>hy : Armenian</li>
63 <li>id : Indonesian</li>
64 <li>is : Icelandic</li>
65 <li>it : Italian</li>
66 <li>ja : Japanese</li>
67 <li>ka : Georgian</li>
68 <li>ko : Korean</li>
69 <li>la : Latin</li>
70 <li>lb : Luxembourgish (added with OOo 3.3)</li>
71 <li>lt : Lithuanian</li>
72 <li>lv : Latvian</li>
73 <li>mr : Marathi</li>
74 <li>ms : Malay</li>
75 <li>ne : Nepali</li>
76 <li>nl : Dutch</li>
77 <li>nb : Norwegian (Bokmal)</li>
78 <li>pl : Polish</li>
79 <li>pt-PT : Portuguese (Portugal)</li>
80 <li>qu : Quechua</li>
81 <li>rm : Romansh</li>
82 <li>ro : Romanian</li>
83 <li>ru : Russian</li>
84 <li>sa : Sanskrit</li>
85 <li>sco : Scots</li>
86 <li>sh : Serbian (written with latin characters)</li>
87 <li>sk-SK : Slovak (written with Latin characters)</li>
88 <li>sl : Slovenian</li>
89 <li>sq : Albanian</li>
90 <li>sr : Serbian (written with cyrillic characters) (added with OOo 3.4)</li>
91 <li>sv : Swedish</li>
92 <li>sw : Swahili</li>
93 <li>ta : Tamil</li>
94 <li>th : Thai</li>
95 <li>tl : Tagalog</li>
96 <li>tr : Turkish</li>
97 <li>uk : Ukrainian</li>
98 <li>vi : Vietnamese</li>
99 <li>yi : Yiddish</li>
100 <li>zh-CN : Chinese (simplified)</li>
101 <li>zh-TW : Chinese (traditional)</li>
102 </ul>
104 </p>
106 @since OOo 2.2
108 interface XLanguageGuessing
110 /** determines the single most probable language of a sub-string.
112 <p>Please note that because statistical analysis is part
113 of the algorithm the likelihood to get the correct
114 result increases with the length of the sub-string.
115 A word is much less likely guessed correctly compared to
116 a sentence or even a whole paragraph.</p>
118 <p>Also note that some languages are that "close" to each other
119 that it will be quite unlikely to find a difference in them,
120 e.g. English (UK), English (IE) and English (AUS) and
121 most likely English (US) as well. And thus the result may
122 be arbitrary.</p>
124 @returns
125 the locale for the language identified.
126 If no language could be identified the locale will be empty.
128 @param aText
129 all the text including the part that should checked.
131 @param nStartPos
132 specifies the starting index of the sub-string to be checked
133 The value must met 0 <= nStartPos < (length of text - 1).
135 @param nLen
136 specifies the length of the sub-string to be checked.
137 The value must met 0 <= nLen <= (length of text).
139 @see com::sun::star::lang::Locale
141 com::sun::star::lang::Locale guessPrimaryLanguage(
142 [in] string aText,
143 [in] long nStartPos,
144 [in] long nLen )
145 raises( com::sun::star::lang::IllegalArgumentException );
147 /** allows to explicitly discard some languages from the set of
148 languages possibly returned.
150 <p>By default all languages are enabled.</p>
152 void disableLanguages(
153 [in] sequence< com::sun::star::lang::Locale > aLanguages )
154 raises( com::sun::star::lang::IllegalArgumentException );
156 /** allows to explicitly re-enable some languages that got previously
157 disabled.
159 <p>By default all languages are enabled.</p>
161 void enableLanguages(
162 [in] sequence< com::sun::star::lang::Locale > aLanguages )
163 raises( com::sun::star::lang::IllegalArgumentException );
165 /** returns a list of all supported languages.
167 <p>This should be the same as the mathematical union of
168 all enabled and disabled languages.</p>
170 sequence< com::sun::star::lang::Locale > getAvailableLanguages();
172 /** returns the list of all enabled languages
174 sequence< com::sun::star::lang::Locale > getEnabledLanguages();
176 /** returns the list of all disabled languages
178 sequence< com::sun::star::lang::Locale > getDisabledLanguages();
182 }; }; }; };
184 #endif
186 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */