From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Sun, 7 Apr 2024 11:06:44 +0200
Subject: Adding upstream version 4:7.4.7.
Signed-off-by: Daniel Baumann
---
.../com/sun/star/linguistic2/XLanguageGuessing.idl | 186 +++++++++++++++++++++
1 file changed, 186 insertions(+)
create mode 100644 offapi/com/sun/star/linguistic2/XLanguageGuessing.idl
(limited to 'offapi/com/sun/star/linguistic2/XLanguageGuessing.idl')
diff --git a/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl b/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl
new file mode 100644
index 000000000..5408ab076
--- /dev/null
+++ b/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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 http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_linguistic2_XLanguageGuessing_idl__
+#define __com_sun_star_linguistic2_XLanguageGuessing_idl__
+
+#include
+#include
+#include
+
+module com { module sun { module star { module linguistic2 {
+
+/** This interface allows to guess the language of a text
+
+ The current set of supported languages is:
+
+ - af : Afrikaans
+ - am : Amharic
+ - ar : Arabic
+ - be : Belarus
+ - br : Breton
+ - bs : Bosnian
+ - ca : Catalan
+ - cs : Czech
+ - cy : Welsh
+ - da : Danish
+ - de : German
+ - drt : Drents
+ - el : Greek
+ - en : English
+ - eo : Esperanto
+ - es : Spanish
+ - et : Estonian
+ - eu : Basque
+ - fa : Persian
+ - fi : Finnish
+ - fr : French
+ - fy : Frisian
+ - ga : Irish Gaelic
+ - gd : Scots Gaelic
+ - gv : Manx Gaelic
+ - he : Hebrew
+ - hi : Hindi
+ - hr : Croatian
+ - hu : Hungarian
+ - hy : Armenian
+ - id : Indonesian
+ - is : Icelandic
+ - it : Italian
+ - ja : Japanese
+ - ka : Georgian
+ - ko : Korean
+ - la : Latin
+ - lb : Luxembourgish (added with OOo 3.3)
+ - lt : Lithuanian
+ - lv : Latvian
+ - mr : Marathi
+ - ms : Malay
+ - ne : Nepali
+ - nl : Dutch
+ - nb : Norwegian (Bokmal)
+ - pl : Polish
+ - pt-PT : Portuguese (Portugal)
+ - qu : Quechua
+ - rm : Romansh
+ - ro : Romanian
+ - ru : Russian
+ - sa : Sanskrit
+ - sco : Scots
+ - sh : Serbian (written with latin characters)
+ - sk-SK : Slovak (written with Latin characters)
+ - sl : Slovenian
+ - sq : Albanian
+ - sr : Serbian (written with cyrillic characters) (added with OOo 3.4)
+ - sv : Swedish
+ - sw : Swahili
+ - ta : Tamil
+ - th : Thai
+ - tl : Tagalog
+ - tr : Turkish
+ - uk : Ukrainian
+ - vi : Vietnamese
+ - yi : Yiddish
+ - zh-CN : Chinese (simplified)
+ - zh-TW : Chinese (traditional)
+
+
+
+
+ @since OOo 2.2
+ */
+interface XLanguageGuessing
+{
+ /** determines the single most probable language of a sub-string.
+
+ Please note that because statistical analysis is part
+ of the algorithm the likelihood to get the correct
+ result increases with the length of the sub-string.
+ A word is much less likely guessed correctly compared to
+ a sentence or even a whole paragraph.
+
+ Also note that some languages are that "close" to each other
+ that it will be quite unlikely to find a difference in them,
+ e.g. English (UK), English (IE) and English (AUS) and
+ most likely English (US) as well. And thus the result may
+ be arbitrary.
+
+ @returns
+ the locale for the language identified.
+ If no language could be identified the locale will be empty.
+
+ @param aText
+ all the text including the part that should checked.
+
+ @param nStartPos
+ specifies the starting index of the sub-string to be checked
+ The value must met 0 <= nStartPos < (length of text - 1).
+
+ @param nLen
+ specifies the length of the sub-string to be checked.
+ The value must met 0 <= nLen <= (length of text).
+
+ @see com::sun::star::lang::Locale
+ */
+ com::sun::star::lang::Locale guessPrimaryLanguage(
+ [in] string aText,
+ [in] long nStartPos,
+ [in] long nLen )
+ raises( com::sun::star::lang::IllegalArgumentException );
+
+ /** allows to explicitly discard some languages from the set of
+ languages possibly returned.
+
+ By default all languages are enabled.
+ */
+ void disableLanguages(
+ [in] sequence< com::sun::star::lang::Locale > aLanguages )
+ raises( com::sun::star::lang::IllegalArgumentException );
+
+ /** allows to explicitly re-enable some languages that got previously
+ disabled.
+
+ By default all languages are enabled.
+ */
+ void enableLanguages(
+ [in] sequence< com::sun::star::lang::Locale > aLanguages )
+ raises( com::sun::star::lang::IllegalArgumentException );
+
+ /** returns a list of all supported languages.
+
+ This should be the same as the mathematical union of
+ all enabled and disabled languages.
+ */
+ sequence< com::sun::star::lang::Locale > getAvailableLanguages();
+
+ /** returns the list of all enabled languages
+ */
+ sequence< com::sun::star::lang::Locale > getEnabledLanguages();
+
+ /** returns the list of all disabled languages
+ */
+ sequence< com::sun::star::lang::Locale > getDisabledLanguages();
+
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
cgit v1.2.3