/* Copyright (C) 2012 Børre Gaup This file is part of the program wordlist2hunspell. 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 3 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 HUNSPELLPRINTERNOCOMPOUNDING_H #define HUNSPELLPRINTERNOCOMPOUNDING_H #include #include #include #include #include "setoptimizer.h" class HunspellPrinterNoCompounding { public: HunspellPrinterNoCompounding(std::string language); std::string getTime(); void printDic(std::map< std::string, int > origStem); std::string makeAffIntroString(); std::string makeAffRepString(); std::string makeAffixString(std::map suffixMap); std::string makeAFString(); std::string getVersion(); std::string printSuffixes(std::map hmhm, std::map origSuffixMap, std::map > newSuffixMap); std::string printAfflist(); void makeAfflist(); std::string makeDicString(std::map< std::string, int > origStem); void printAffFile(std::map< std::string, int > hmhm, std::map origSuffixMap, std::map > newSuffixMap); std::set< std::set< int > > getAffixSetsFromStems(std::map< std::set< int >, std::set< int > > affixSetStems); std::set< std::set< int > > splitAffixSetsIntoSubSets( std::set< std::set< int > > affixSetVector ); std::map< int, std::set< int > > mapSubSets(std::set< std::set< int > > prefixSubSets); std::map< std::set< int >, std::set< int > > giveSubsetsToStems(std::map< int, std::set< int > > subSetMap, std::map< std::set< int >, std::set< int > > prefixSetStemsMap); std::map< std::string, int > preparePLXClasses(std::set< std::string > plxClasses); void prepareAfmap(std::map, std::set > suffixSetStemsMap); private: void setConstantsMap(); void giveNewSuffixSubsetsToStems(std::map< std::set< int >, std::set< int > > affixSetStemsMap); std::string getLangString(); std::string makeDicEasterEgg(); std::string makeAffEasterEgg(); void addSet(std::map< std::set< int >, std::set< int > > inmap, std::set< int >& affSet, int index); std::set< std::string > readClitics(); // This contains all mappings between stems and suffixes std::map< std::set, std::set > _suffixesStemsMap; std::string _language; std::string _gthome; std::map _afMap; std::map _stemMap; // This one is used as a global index for PFX and SFX (derivations // and suffixes) for printing to the .aff file int _affixIndex; int _hunspellMax; std::map _constantsMap; }; #endif // HUNSPELLPRINTERNOCOMPOUNDING_H