Commit a8d54151bf95b8235f5801d70cf7088edf1e283a
1 parent
a1c22216
- poprawki bałaganu, który się tu wkradł
git-svn-id: svn://svn.nlp.ipipan.waw.pl/morfeusz/trunk@289 ff4e3ee1-f430-4e82-ade0-24591c43f1fd
Showing
11 changed files
with
19 additions
and
60 deletions
CMakeLists.txt
... | ... | @@ -127,7 +127,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
127 | 127 | set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc -Wl,--exclude-libs,libgcc_eh.a") |
128 | 128 | set (CMAKE_EXE_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc") |
129 | 129 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
130 | - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") | |
130 | + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall") | |
131 | 131 | if (NOT INSTALL_NAME_TOOL) |
132 | 132 | set (INSTALL_NAME_TOOL install_name_tool) |
133 | 133 | endif () |
... | ... |
morfeusz/DictionariesRepository.cpp
... | ... | @@ -19,8 +19,8 @@ namespace morfeusz { |
19 | 19 | using namespace std; |
20 | 20 | |
21 | 21 | DictionariesRepository& DictionariesRepository::getInstance() { |
22 | - static DictionariesRepository res; | |
23 | - return res; | |
22 | + static DictionariesRepository* res = new DictionariesRepository(); | |
23 | + return *res; | |
24 | 24 | } |
25 | 25 | |
26 | 26 | string DictionariesRepository::getDictionaryFilename(const std::string& name, MorfeuszProcessorType processorType) { |
... | ... |
morfeusz/DictionariesRepository.hpp
... | ... | @@ -33,6 +33,7 @@ namespace morfeusz { |
33 | 33 | private: |
34 | 34 | |
35 | 35 | struct RepositoryEntry { |
36 | + RepositoryEntry(): analyzerDictionary(NULL), generatorDictionary(NULL) {} | |
36 | 37 | Dictionary* analyzerDictionary; |
37 | 38 | Dictionary* generatorDictionary; |
38 | 39 | Dictionary* getDictionary(MorfeuszProcessorType processorType) const; |
... | ... |
morfeusz/IdResolverImpl.cpp
... | ... | @@ -30,8 +30,6 @@ namespace morfeusz { |
30 | 30 | template <class T> |
31 | 31 | inline static const T& getFromMap(map<string, T> string2T, const string& key, const char* errMsg) { |
32 | 32 | if (string2T.count(key) != 0) { |
33 | -// map<string, T>::const_iterator it; | |
34 | -// it = string2T.find(key); | |
35 | 33 | return string2T.find(key)->second; |
36 | 34 | } |
37 | 35 | else { |
... | ... | @@ -90,21 +88,12 @@ namespace morfeusz { |
90 | 88 | convertCharset(charsetConverter, this->tags); |
91 | 89 | convertCharset(charsetConverter, this->names); |
92 | 90 | convertCharset(charsetConverter, this->labels); |
93 | -// for (unsigned int i = 0; i < tags.id2String.size(); i++) { | |
94 | -// tags.id2String[i] = charsetConverter->fromUTF8( | |
95 | -// this->charsetConverter->toUTF8(tags[i])); | |
96 | -// } | |
97 | -// | |
98 | -// for (unsigned int j = 0; j < names.id2String.size(); j++) { | |
99 | -// names[j] = charsetConverter->fromUTF8( | |
100 | -// this->charsetConverter->toUTF8(names[j])); | |
101 | -// } | |
102 | 91 | |
103 | 92 | this->charsetConverter = charsetConverter; |
104 | 93 | } |
105 | 94 | |
106 | 95 | const string IdResolverImpl::getTagsetId() const { |
107 | - | |
96 | + return this->tagsetId; | |
108 | 97 | } |
109 | 98 | |
110 | 99 | const string& IdResolverImpl::getTag(const int tagId) const { |
... | ... |
morfeusz/InterpsGroup.hpp
morfeusz/Morfeusz.cpp
... | ... | @@ -8,19 +8,20 @@ namespace morfeusz { |
8 | 8 | using namespace std; |
9 | 9 | |
10 | 10 | string Morfeusz::getVersion() { |
11 | - static string version = MORFEUSZ2_VERSION; | |
12 | - return version; | |
11 | + // string version = MORFEUSZ2_VERSION; | |
12 | + cerr << "VERSION" << endl; | |
13 | + return string(MORFEUSZ2_VERSION); | |
13 | 14 | } |
14 | 15 | |
15 | 16 | string Morfeusz::getDefaultDictName() { |
16 | - static string dictName = MORFEUSZ_DEFAULT_DICT_NAME; | |
17 | - return dictName; | |
17 | + // string dictName = MORFEUSZ_DEFAULT_DICT_NAME; | |
18 | + return string(MORFEUSZ_DEFAULT_DICT_NAME); | |
18 | 19 | } |
19 | 20 | |
20 | 21 | Morfeusz* Morfeusz::createInstance(MorfeuszUsage usage) { |
21 | 22 | return new MorfeuszImpl(Morfeusz::getDefaultDictName(), usage); |
22 | 23 | } |
23 | - | |
24 | + | |
24 | 25 | Morfeusz* Morfeusz::createInstance(const std::string& dictName, MorfeuszUsage usage) { |
25 | 26 | return new MorfeuszImpl(dictName, usage); |
26 | 27 | } |
... | ... |
morfeusz/c_api/ResultsManager.cpp
morfeusz/cli/cli.cpp
... | ... | @@ -121,9 +121,9 @@ namespace morfeusz { |
121 | 121 | 1, // Number of args expected. |
122 | 122 | 0, // Delimiter if expecting multiple args. |
123 | 123 | "whitespace handling strategy.\n \ |
124 | -SKIP_WHITESPACES - ignore whitespaces\n \ | |
125 | -APPEND_WHITESPACES - append whitespaces to preceding segment\n\ | |
126 | -KEEP_WHITESPACES - whitespaces are separate segments\n", // Help description. | |
124 | +* SKIP_WHITESPACES - ignore whitespaces\n \ | |
125 | +* APPEND_WHITESPACES - append whitespaces to preceding segment\n\ | |
126 | +* KEEP_WHITESPACES - whitespaces are separate segments\n", // Help description. | |
127 | 127 | // "-whitespace-handling", // Flag token. |
128 | 128 | "--whitespace-handling" // Flag token. |
129 | 129 | ); |
... | ... |
morfeusz/morfeusz2.h
... | ... | @@ -276,7 +276,7 @@ namespace morfeusz { |
276 | 276 | * List of paths where current Morfeusz instance will look for dictionaries. |
277 | 277 | * Modifying it is NOT THREAD-SAFE. |
278 | 278 | */ |
279 | - static std::vector<std::string>& getDictionarySearchPaths(); | |
279 | + static std::list<std::string> dictionarySearchPaths; | |
280 | 280 | |
281 | 281 | /** |
282 | 282 | * Get available parameters for "setAggl" method. |
... | ... |
morfeusz/morfeusz_analyzer.cpp
... | ... | @@ -16,13 +16,12 @@ using namespace std; |
16 | 16 | using namespace morfeusz; |
17 | 17 | |
18 | 18 | int main(int argc, const char** argv) { |
19 | - cerr << "Morfeusz analyzer, version: " << MORFEUSZ2_VERSION << endl; | |
19 | + cerr << "Morfeusz analyzer, version: " << Morfeusz::getVersion() << endl; | |
20 | 20 | ez::ezOptionParser& opt = *getOptions(argc, argv, ANALYZER); |
21 | 21 | Morfeusz* morfeusz = initializeMorfeusz(opt, ANALYZER); |
22 | 22 | string line; |
23 | 23 | vector<MorphInterpretation> res; |
24 | 24 | while (getline(cin, line)) { |
25 | -// printf("%s\n", line.c_str()); | |
26 | 25 | res.clear(); |
27 | 26 | morfeusz->analyse(line, res); |
28 | 27 | printMorphResults(*morfeusz, res, true); |
... | ... |
nbproject/configurations.xml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | -<configurationDescriptor version="94"> | |
2 | +<configurationDescriptor version="95"> | |
3 | 3 | <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT"> |
4 | 4 | <logicalFolder name="build" |
5 | 5 | displayName="build" |
... | ... | @@ -794,45 +794,29 @@ |
794 | 794 | </ccTool> |
795 | 795 | </item> |
796 | 796 | <item path="morfeusz/c_api/ResultsManager.cpp" ex="false" tool="1" flavor2="4"> |
797 | - <ccTool flags="1"> | |
798 | - </ccTool> | |
799 | 797 | </item> |
800 | 798 | <item path="morfeusz/case/CaseConverter.cpp" ex="false" tool="1" flavor2="4"> |
801 | - <ccTool flags="1"> | |
802 | - </ccTool> | |
803 | 799 | </item> |
804 | 800 | <item path="morfeusz/case/CasePatternHelper.cpp" |
805 | 801 | ex="false" |
806 | 802 | tool="1" |
807 | 803 | flavor2="4"> |
808 | - <ccTool flags="1"> | |
809 | - </ccTool> | |
810 | 804 | </item> |
811 | 805 | <item path="morfeusz/case/caseconv.cpp" ex="false" tool="1" flavor2="4"> |
812 | - <ccTool flags="1"> | |
813 | - </ccTool> | |
814 | 806 | </item> |
815 | 807 | <item path="morfeusz/charset/CharsetConverter.cpp" |
816 | 808 | ex="false" |
817 | 809 | tool="1" |
818 | 810 | flavor2="4"> |
819 | - <ccTool flags="1"> | |
820 | - </ccTool> | |
821 | 811 | </item> |
822 | 812 | <item path="morfeusz/charset/TextReader.cpp" ex="false" tool="1" flavor2="4"> |
823 | - <ccTool flags="1"> | |
824 | - </ccTool> | |
825 | 813 | </item> |
826 | 814 | <item path="morfeusz/charset/conversion_tables.cpp" |
827 | 815 | ex="false" |
828 | 816 | tool="1" |
829 | 817 | flavor2="4"> |
830 | - <ccTool flags="1"> | |
831 | - </ccTool> | |
832 | 818 | </item> |
833 | 819 | <item path="morfeusz/cli/cli.cpp" ex="false" tool="1" flavor2="4"> |
834 | - <ccTool flags="1"> | |
835 | - </ccTool> | |
836 | 820 | </item> |
837 | 821 | <item path="morfeusz/const.cpp" ex="false" tool="1" flavor2="4"> |
838 | 822 | <ccTool flags="1"> |
... | ... | @@ -854,40 +838,28 @@ |
854 | 838 | ex="false" |
855 | 839 | tool="1" |
856 | 840 | flavor2="4"> |
857 | - <ccTool flags="1"> | |
858 | - </ccTool> | |
859 | 841 | </item> |
860 | 842 | <item path="morfeusz/deserialization/MorphDeserializer.cpp" |
861 | 843 | ex="false" |
862 | 844 | tool="1" |
863 | 845 | flavor2="4"> |
864 | - <ccTool flags="1"> | |
865 | - </ccTool> | |
866 | 846 | </item> |
867 | 847 | <item path="morfeusz/deserialization/morphInterps/InterpretedChunksDecoder.cpp" |
868 | 848 | ex="false" |
869 | 849 | tool="1" |
870 | 850 | flavor2="4"> |
871 | - <ccTool flags="1"> | |
872 | - </ccTool> | |
873 | 851 | </item> |
874 | 852 | <item path="morfeusz/deserialization/morphInterps/InterpretedChunksDecoder4Analyzer.cpp" |
875 | 853 | ex="false" |
876 | 854 | tool="1" |
877 | 855 | flavor2="4"> |
878 | - <ccTool flags="1"> | |
879 | - </ccTool> | |
880 | 856 | </item> |
881 | 857 | <item path="morfeusz/deserialization/morphInterps/InterpretedChunksDecoder4Generator.cpp" |
882 | 858 | ex="false" |
883 | 859 | tool="1" |
884 | 860 | flavor2="4"> |
885 | - <ccTool flags="1"> | |
886 | - </ccTool> | |
887 | 861 | </item> |
888 | 862 | <item path="morfeusz/fsa/const.cpp" ex="false" tool="1" flavor2="4"> |
889 | - <ccTool flags="1"> | |
890 | - </ccTool> | |
891 | 863 | </item> |
892 | 864 | <item path="morfeusz/morfeusz2_c.cpp" ex="false" tool="1" flavor2="4"> |
893 | 865 | <ccTool flags="1"> |
... | ... | @@ -936,12 +908,8 @@ |
936 | 908 | </ccTool> |
937 | 909 | </item> |
938 | 910 | <item path="morfeusz/segrules/SegrulesFSA.cpp" ex="false" tool="1" flavor2="4"> |
939 | - <ccTool flags="1"> | |
940 | - </ccTool> | |
941 | 911 | </item> |
942 | 912 | <item path="morfeusz/segrules/segrules.cpp" ex="false" tool="1" flavor2="4"> |
943 | - <ccTool flags="1"> | |
944 | - </ccTool> | |
945 | 913 | </item> |
946 | 914 | <item path="morfeusz/test_runner.cpp" ex="false" tool="1" flavor2="4"> |
947 | 915 | <ccTool flags="0"> |
... | ... |