commit d69108e5fdbe2fef54ddd991e514abc803977b5b Author: Daniel Swanson Date: Thu Jun 10 14:05:55 2021 -0500 finish dropping ltstr diff --git a/apertium/Makefile.am b/apertium/Makefile.am index 3db38ce..494cfd4 100644 --- a/apertium/Makefile.am +++ b/apertium/Makefile.am @@ -70,7 +70,6 @@ h_sources = a.h \ transfer_mult.h \ transfer_token.h \ transfer_word.h \ - transfer_word_list.h \ trx_reader.h \ tsx_reader.h \ ttag.h \ @@ -138,7 +137,6 @@ cc_sources = a.cc \ transfer_mult.cc \ transfer_token.cc \ transfer_word.cc \ - transfer_word_list.cc \ trx_reader.cc \ tsx_reader.cc \ unigram_tagger.cc \ diff --git a/apertium/deformat.xsl b/apertium/deformat.xsl index fd93401..56c2aa6 100644 --- a/apertium/deformat.xsl +++ b/apertium/deformat.xsl @@ -164,7 +164,6 @@ extern "C" { } #include <lttoolbox/lt_locale.h> -#include <lttoolbox/ltstr.h> #include <apertium/string_to_wostream.h> #ifndef GENFORMAT #include "apertium_config.h" @@ -302,7 +301,7 @@ string get_tagName(string tag){ - + diff --git a/apertium/reformat.xsl b/apertium/reformat.xsl index 3316b42..0fca2bc 100644 --- a/apertium/reformat.xsl +++ b/apertium/reformat.xsl @@ -36,7 +36,6 @@ #include <string> #include <unistd.h> #include <lttoolbox/lt_locale.h> -#include <lttoolbox/ltstr.h> #include <apertium/string_to_wostream.h> #include <wchar.h> #ifdef _WIN32 @@ -51,7 +50,7 @@ using namespace std; - + diff --git a/apertium/tagger_data.h b/apertium/tagger_data.h index beba330..2b7dd26 100644 --- a/apertium/tagger_data.h +++ b/apertium/tagger_data.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/apertium/transfer_word_list.cc b/apertium/transfer_word_list.cc deleted file mode 100644 index 9b730dd..0000000 --- a/apertium/transfer_word_list.cc +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ -#include -#include - -using namespace Apertium; -void -TransferWordList::copy(TransferWordList const &o) -{ - casefull_set = o.casefull_set; - caseless_set = o.caseless_set; -} - -void -TransferWordList::destroy() -{ -} - -TransferWordList::TransferWordList() -{ -} - -TransferWordList::~TransferWordList() -{ - destroy(); -} - -TransferWordList::TransferWordList(TransferWordList const &o) -{ - copy(o); -} - -TransferWordList & -TransferWordList::operator =(TransferWordList const &o) -{ - if(this != &o) - { - destroy(); - copy(o); - } - return *this; -} - -bool -TransferWordList::search(string const &cad, bool caseless) -{ - if(caseless) - { - return caseless_set.find(cad) != caseless_set.end(); - } - else - { - return casefull_set.find(cad) != casefull_set.end(); - } -} - -void -TransferWordList::addWord(string const &cad) -{ - casefull_set.insert(cad); - caseless_set.insert(cad); -} diff --git a/apertium/transfer_word_list.h b/apertium/transfer_word_list.h deleted file mode 100644 index 6e3f602..0000000 --- a/apertium/transfer_word_list.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ -#ifndef _TRANSFERWORDLIST_ -#define _TRANSFERWORDLIST_ - -#include -#include -#include -#ifdef _MSC_VER -#define strcasecmp _stricmp -#endif - -using namespace std; - -struct ltstr -{ - bool operator()(string const &s1, string const &s2) const - { - return s1 < s2; - } -}; - -struct ltstri -{ - bool operator()(string const &s1, string const &s2) const - { - return strcasecmp(s1.c_str(), s2.c_str()) < 0; - } -}; - -class TransferWordList -{ -private: - set casefull_set; - set caseless_set; - - void copy(TransferWordList const &o); - void destroy(); -public: - TransferWordList(); - ~TransferWordList(); - TransferWordList(TransferWordList const &o); - TransferWordList & operator =(TransferWordList const &o); - - bool search(string const &cad, bool caseless = false); - void addWord(string const &cad); -}; - -#endif