summaryrefslogtreecommitdiff
path: root/lingucomponent/source/languageguessing
diff options
context:
space:
mode:
authorAlexander Wilms <f.alexander.wilms@gmail.com>2014-02-26 16:06:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-02-26 10:04:11 -0600
commit412c47ded694df2f955b4c590f096238eb549d3d (patch)
treec648fe29f9e24e5648e693ddd0640252e1e053f4 /lingucomponent/source/languageguessing
parent99e3bd454bf607c5b561e2dc8e0f7a04f2bc28ed (diff)
Remove visual noise from lingucomponent
Change-Id: I6021eabab1474c99868f38ecd0d466eb0d97054e Reviewed-on: https://gerrit.libreoffice.org/8279 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lingucomponent/source/languageguessing')
-rw-r--r--lingucomponent/source/languageguessing/guess.cxx10
-rw-r--r--lingucomponent/source/languageguessing/guesslang.cxx23
-rw-r--r--lingucomponent/source/languageguessing/simpleguesser.cxx11
3 files changed, 7 insertions, 37 deletions
diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx
index f1e54179a26f..1e3cb3e33acf 100644
--- a/lingucomponent/source/languageguessing/guess.cxx
+++ b/lingucomponent/source/languageguessing/guess.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <iostream>
#include <string.h>
@@ -52,7 +51,6 @@ Guess::Guess()
* a string like those is made as : [language-country-encoding]...
*
*/
-
Guess::Guess(const char * guess_str)
{
Guess();
@@ -62,10 +60,10 @@ Guess::Guess(const char * guess_str)
string enc;
//if the guess is not like "UNKNOWN" or "SHORT", go into the brackets
- if(strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_UNKNOWN_STR) != 0
- &&
- strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_SHORT_STR) != 0)
- {
+ if(strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_UNKNOWN_STR) != 0
+ &&
+ strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_SHORT_STR) != 0)
+ {
int current_pointer = 0;
diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx
index a65ec51de4ab..361a67aebbd6 100644
--- a/lingucomponent/source/languageguessing/guesslang.cxx
+++ b/lingucomponent/source/languageguessing/guesslang.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <iostream>
#include <tools/debug.hxx>
@@ -54,8 +53,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::linguistic2;
-//==================================================================================================
-
#define SERVICENAME "com.sun.star.linguistic2.LanguageGuessing"
#define IMPLNAME "com.sun.star.lingu2.LanguageGuessing"
@@ -77,7 +74,6 @@ static osl::Mutex & GetLangGuessMutex()
return aMutex;
}
-
class LangGuess_Impl :
public ::cppu::WeakImplHelper2<
XLanguageGuessing,
@@ -117,16 +113,12 @@ public:
};
-//*************************************************************************
-
LangGuess_Impl::LangGuess_Impl(css::uno::Reference< css::uno::XComponentContext > const & rxContext) :
m_bInitialized( false ),
m_xContext( rxContext )
{
}
-//*************************************************************************
-
void LangGuess_Impl::EnsureInitialized()
{
if (!m_bInitialized)
@@ -148,9 +140,8 @@ void LangGuess_Impl::EnsureInitialized()
SetFingerPrintsDB( aPhysPath );
#if !defined(EXTTEXTCAT_VERSION_MAJOR)
- //
+
// disable currently not functional languages...
- //
struct LangCountry
{
const char *pLang;
@@ -160,7 +151,6 @@ void LangGuess_Impl::EnsureInitialized()
{
// not functional in modified libtextcat, but fixed in >= libexttextcat 3.1.0
// which is the first with EXTTEXTCAT_VERSION_MAJOR defined
-
{"sco", ""}, {"zh", "CN"}, {"zh", "TW"}, {"ja", ""}, {"ko", ""},
{"ka", ""}, {"hi", ""}, {"mr", ""}, {"ne", ""}, {"sa", ""},
{"ta", ""}, {"th", ""}, {"qu", ""}, {"yi", ""}
@@ -181,8 +171,6 @@ void LangGuess_Impl::EnsureInitialized()
}
}
-//*************************************************************************
-
Locale SAL_CALL LangGuess_Impl::guessPrimaryLanguage(
const OUString& rText,
::sal_Int32 nStartPos,
@@ -207,7 +195,6 @@ Locale SAL_CALL LangGuess_Impl::guessPrimaryLanguage(
return aRes;
}
-//*************************************************************************
#define DEFAULT_CONF_FILE_NAME "fpdb.conf"
void LangGuess_Impl::SetFingerPrintsDB(
@@ -223,7 +210,6 @@ void LangGuess_Impl::SetFingerPrintsDB(
m_aGuesser.SetDBPath((const char*)conf_file_path.getStr(), (const char*)path.getStr());
}
-//*************************************************************************
uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages( )
throw (uno::RuntimeException)
{
@@ -247,7 +233,6 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages( )
return aRes;
}
-//*************************************************************************
uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages( )
throw (uno::RuntimeException)
{
@@ -271,7 +256,6 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages( )
return aRes;
}
-//*************************************************************************
uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages( )
throw (uno::RuntimeException)
{
@@ -295,7 +279,6 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages( )
return aRes;
}
-//*************************************************************************
void SAL_CALL LangGuess_Impl::disableLanguages(
const uno::Sequence< Locale >& rLanguages )
throw (lang::IllegalArgumentException, uno::RuntimeException)
@@ -321,7 +304,6 @@ void SAL_CALL LangGuess_Impl::disableLanguages(
}
}
-//*************************************************************************
void SAL_CALL LangGuess_Impl::enableLanguages(
const uno::Sequence< Locale >& rLanguages )
throw (lang::IllegalArgumentException, uno::RuntimeException)
@@ -384,10 +366,7 @@ Reference< XInterface > SAL_CALL LangGuess_Impl_create(
return static_cast< ::cppu::OWeakObject * >( new LangGuess_Impl(xContext) );
}
-//##################################################################################################
//#### EXPORTED ### functions to allow for registration and creation of the UNO component
-//##################################################################################################
-
static const struct ::cppu::ImplementationEntry s_component_entries [] =
{
{
diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx b/lingucomponent/source/languageguessing/simpleguesser.cxx
index eea6a69f8ef1..055e785bd022 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -27,7 +27,6 @@
* - Not init h when implicit constructor is launched
*/
-
#include <string.h>
#include <sstream>
#include <iostream>
@@ -53,11 +52,9 @@
using namespace std;
-
/**
* This 3 following structures are from fingerprint.c and textcat.c
*/
-
typedef struct ngram_t {
sint2 rank;
@@ -83,7 +80,7 @@ typedef struct textcat_t{
char output[MAXOUTPUTSIZE];
} textcat_t;
-/** end of the 3 structs */
+// end of the 3 structs
SimpleGuesser::SimpleGuesser()
{
@@ -93,7 +90,7 @@ SimpleGuesser::SimpleGuesser()
SimpleGuesser& SimpleGuesser::operator=(const SimpleGuesser& sg){
// Check for self-assignment!
if (this == &sg) // Same object?
- return *this; // Yes, so skip assignment, and just return *this.
+ return *this; // Yes, so skip assignment, and just return *this.
if(h){textcat_Done(h);}
h = sg.h;
@@ -105,7 +102,6 @@ SimpleGuesser::~SimpleGuesser()
if(h){textcat_Done(h);}
}
-
/*!
\fn SimpleGuesser::GuessLanguage(char* text)
*/
@@ -221,9 +217,6 @@ void SimpleGuesser::DisableLanguage(string lang)
XableLanguage(lang, sal::static_int_cast< char >( 0x0F ));
}
-/**
-*
-*/
void SimpleGuesser::SetDBPath(const char* path, const char* prefix)
{
if (h)