1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 module com
{ module sun
{ module star
{ module linguistic2
{
22 /** This interface allows to guess the language of a text
24 <p> The current set of supported languages is:
26 <li>af : Afrikaans</li>
40 <li>eo : Esperanto</li>
42 <li>et : Estonian</li>
48 <li>ga : Irish Gaelic</li>
49 <li>gd : Scots Gaelic</li>
50 <li>gv : Manx Gaelic</li>
53 <li>hr : Croatian</li>
54 <li>hu : Hungarian</li>
55 <li>hy : Armenian</li>
56 <li>id : Indonesian</li>
57 <li>is : Icelandic</li>
59 <li>ja : Japanese</li>
60 <li>ka : Georgian</li>
63 <li>lb : Luxembourgish (added with OOo 3.3)</li>
64 <li>lt : Lithuanian</li>
70 <li>nb : Norwegian (Bokmal)</li>
72 <li>pt-PT : Portuguese (Portugal)</li>
75 <li>ro : Romanian</li>
77 <li>sa : Sanskrit</li>
79 <li>sh : Serbian (written with latin characters)</li>
80 <li>sk-SK : Slovak (written with Latin characters)</li>
81 <li>sl : Slovenian</li>
82 <li>sq : Albanian</li>
83 <li>sr : Serbian (written with cyrillic characters) (added with OOo 3.4)</li>
90 <li>uk : Ukrainian</li>
91 <li>vi : Vietnamese</li>
93 <li>zh-CN : Chinese (simplified)</li>
94 <li>zh-TW : Chinese (traditional)</li>
101 interface XLanguageGuessing
103 /** determines the single most probable language of a sub-string.
105 <p>Please note that because statistical analysis is part
106 of the algorithm the likelihood to get the correct
107 result increases with the length of the sub-string.
108 A word is much less likely guessed correctly compared to
109 a sentence or even a whole paragraph.</p>
111 <p>Also note that some languages are that "close" to each other
112 that it will be quite unlikely to find a difference in them,
113 e.g. English (UK), English (IE) and English (AUS) and
114 most likely English (US) as well. And thus the result may
118 the locale for the language identified.
119 If no language could be identified the locale will be empty.
122 all the text including the part that should checked.
125 specifies the starting index of the sub-string to be checked
126 The value must met 0 <= nStartPos < (length of text - 1).
129 specifies the length of the sub-string to be checked.
130 The value must met 0 <= nLen <= (length of text).
132 @see com::sun::star::lang::Locale
134 com
::sun
::star
::lang
::Locale guessPrimaryLanguage
(
138 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
140 /** allows to explicitly discard some languages from the set of
141 languages possibly returned.
143 <p>By default all languages are enabled.</p>
145 void disableLanguages
(
146 [in] sequence
< com
::sun
::star
::lang
::Locale
> aLanguages
)
147 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
149 /** allows to explicitly re-enable some languages that got previously
152 <p>By default all languages are enabled.</p>
154 void enableLanguages
(
155 [in] sequence
< com
::sun
::star
::lang
::Locale
> aLanguages
)
156 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
158 /** returns a list of all supported languages.
160 <p>This should be the same as the mathematical union of
161 all enabled and disabled languages.</p>
163 sequence
< com
::sun
::star
::lang
::Locale
> getAvailableLanguages
();
165 /** returns the list of all enabled languages
167 sequence
< com
::sun
::star
::lang
::Locale
> getEnabledLanguages
();
169 /** returns the list of all disabled languages
171 sequence
< com
::sun
::star
::lang
::Locale
> getDisabledLanguages
();
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */