From 84a01b04cbbc132e4a7dd77d458a0c952ebbc104 Mon Sep 17 00:00:00 2001
From: Michał Lenart <michall@ipipan.waw.pl>
Date: Sat, 8 Mar 2014 16:13:43 +0000
Subject: [PATCH] - segmentacja wreszcie działa w miarę tak, jak trzeba (poprawiony bug z naj-)

---
 CMakeLists.txt                                      |  6 +++---
 fsabuilder/morfeuszbuilder/fsa/state.py             |  2 +-
 fsabuilder/morfeuszbuilder/segrules/preprocessor.py |  2 +-
 fsabuilder/morfeuszbuilder/segrules/rules.py        | 17 ++++++++++++++++-
 fsabuilder/morfeuszbuilder/segrules/rulesParser.py  | 14 ++++++++------
 fsabuilder/morfeuszbuilder/tagset/segtypes.py       |  4 +++-
 input/segmenty.dat                                  |  2 +-
 input/segmenty1.dat                                 |  5 ++++-
 morfeusz/FlexionGraph.cpp                           | 11 +++++++----
 morfeusz/InterpretedChunk.hpp                       |  3 +++
 morfeusz/InterpretedChunksDecoder.hpp               | 13 +++++++++++--
 morfeusz/Morfeusz.cpp                               | 42 +++++++++++++++++++++++++-----------------
 morfeusz/java/dupa                                  | 36 ++++++++++++++++++++++++++++++++++++
 nbproject/configurations.xml                        | 61 ++++++++++++++++++++++++++++++++++++++++++++-----------------
 14 files changed, 163 insertions(+), 55 deletions(-)
 create mode 100644 morfeusz/java/dupa

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5336eb7..06b61a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,13 +30,13 @@ set (PROJECT_VERSION "${Morfeusz_VERSION_MAJOR}.${Morfeusz_VERSION_MINOR}.${Morf
 ### USER DEFINED VARIABLES
 
 # INPUT_DICTIONARY_CPP
-set (INPUT_DICTIONARY_CPP "${PROJECT_SOURCE_DIR}/default_fsa.cpp")
-set (INPUT_SYNTH_DICTIONARY_CPP "${PROJECT_SOURCE_DIR}/default_synth_fsa.cpp")
+set (INPUT_DICTIONARY_CPP "${PROJECT_SOURCE_DIR}/../default_fsa.cpp")
+set (INPUT_SYNTH_DICTIONARY_CPP "${PROJECT_SOURCE_DIR}/../default_synth_fsa.cpp")
 if ("${INPUT_DICTIONARIES}" STREQUAL "")
    if ("${EMPTY_INPUT_DICTIONARY}" STREQUAL "TRUE")
     set (INPUT_DICTIONARIES ${PROJECT_SOURCE_DIR}/input/empty.txt)
    else ()
-    set (INPUT_DICTIONARIES "${PROJECT_SOURCE_DIR}/input/PoliMorf-0.6.7.tab,${PROJECT_SOURCE_DIR}/input/dodatki.tab")
+    set (INPUT_DICTIONARIES "${PROJECT_SOURCE_DIR}/input/PoliMorfSmall.tab,${PROJECT_SOURCE_DIR}/input/dodatki.tab")
    endif ()
 endif ()
 
diff --git a/fsabuilder/morfeuszbuilder/fsa/state.py b/fsabuilder/morfeuszbuilder/fsa/state.py
index 5292b87..07dbc63 100644
--- a/fsabuilder/morfeuszbuilder/fsa/state.py
+++ b/fsabuilder/morfeuszbuilder/fsa/state.py
@@ -70,6 +70,6 @@ class State(object):
     
     def debug(self):
         print '----------------'
-        print 'STATE:', self.idx
+        print 'STATE:', self.idx, 'accepting', self.isAccepting()
         for label, s in self.transitionsMap.iteritems():
             print label, '-->', s.idx
diff --git a/fsabuilder/morfeuszbuilder/segrules/preprocessor.py b/fsabuilder/morfeuszbuilder/segrules/preprocessor.py
index 2313709..9376a80 100644
--- a/fsabuilder/morfeuszbuilder/segrules/preprocessor.py
+++ b/fsabuilder/morfeuszbuilder/segrules/preprocessor.py
@@ -6,7 +6,7 @@ Created on 23 sty 2014
 import re
 from pyparsing import *
 
-identifier = Word(alphas, bodyChars=alphanums+'_>*+')
+identifier = Word(alphas, bodyChars=alphanums+'_>*+!')
 define = Keyword('#define').suppress() + identifier + Optional(Suppress('(') + identifier + Suppress(')')) + restOfLine + LineEnd() + StringEnd()
 ifdef = Keyword('#ifdef').suppress() + identifier + LineEnd() + StringEnd()
 endif = Keyword('#endif').suppress() + LineEnd() + StringEnd()
diff --git a/fsabuilder/morfeuszbuilder/segrules/rules.py b/fsabuilder/morfeuszbuilder/segrules/rules.py
index 814a54b..5ff2f53 100644
--- a/fsabuilder/morfeuszbuilder/segrules/rules.py
+++ b/fsabuilder/morfeuszbuilder/segrules/rules.py
@@ -122,4 +122,19 @@ class ShiftOrthRule(UnaryRule):
         startState.setTransitionData(self.child.segnum, 1)
     
     def __str__(self):
-        return u'(' + str(self.child) + ')>'
\ No newline at end of file
+        return u'(' + str(self.child) + ')>'
+
+class ShiftOrthSameTypeRule(UnaryRule):
+    
+    def __init__(self, child):
+        super(ShiftOrthSameTypeRule, self).__init__(child)
+    
+    def addToNFA(self, fsa):
+        raise ValueError()
+    
+    def _doAddToNFA(self, startState, endState):
+        self.child._doAddToNFA(startState, endState)
+        startState.setTransitionData(self.child.segnum, 2)
+    
+    def __str__(self):
+        return u'(' + str(self.child) + ')!>'
diff --git a/fsabuilder/morfeuszbuilder/segrules/rulesParser.py b/fsabuilder/morfeuszbuilder/segrules/rulesParser.py
index b39afa2..22bda6c 100644
--- a/fsabuilder/morfeuszbuilder/segrules/rulesParser.py
+++ b/fsabuilder/morfeuszbuilder/segrules/rulesParser.py
@@ -43,19 +43,19 @@ class RulesParser(object):
         firstNFA = None
         for defs in itertools.product(*key2Defs.values()):
             key2Def = dict([(def2Key[define], define) for define in defs])
-            print key2Def
+#             print key2Def
             nfa = rulesNFA.RulesNFA()
             if not firstNFA:
                 firstNFA = nfa
             combinationEnumeratedLines = segtypesConfigFile.enumerateLinesInSection('combinations')
             combinationEnumeratedLines = list(preprocessor.preprocess(combinationEnumeratedLines, defs))
             for rule in self._doParse(combinationEnumeratedLines, segtypesHelper):
-                print rule
+#                 print rule
                 rule.addToNFA(nfa)
-                nfa.debug()
+#                 nfa.debug()
             dfa = nfa.convertToDFA()
-            print '********* DFA **************'
-            dfa.debug()
+#             print '********* DFA **************'
+#             dfa.debug()
 #             print dfa.tryToRecognize(bytearray([14]))
             res.addDFA(key2Def, dfa)
         return res
@@ -76,8 +76,9 @@ class RulesParser(object):
         rule = Forward()
         tagRule = Word(alphanums+'_')
         shiftOrthRule = tagRule + '>'
+        shiftOrthSameTypeRule = tagRule + '!' + '>'
         parenRule = Suppress('(') + rule + Suppress(')')
-        atomicRule = tagRule ^ shiftOrthRule ^ parenRule
+        atomicRule = tagRule ^ shiftOrthRule ^ shiftOrthSameTypeRule ^ parenRule
         zeroOrMoreRule = atomicRule + Suppress('*')
         oneOrMoreRule = atomicRule + Suppress('+')
         unaryRule = atomicRule ^ zeroOrMoreRule ^ oneOrMoreRule
@@ -88,6 +89,7 @@ class RulesParser(object):
         
         tagRule.setParseAction(lambda string, loc, toks: self._createNewTagRule(toks[0], lineNum, line, segtypesHelper))
         shiftOrthRule.setParseAction(lambda string, loc, toks: rules.ShiftOrthRule(toks[0]))
+        shiftOrthSameTypeRule.setParseAction(lambda string, loc, toks: rules.ShiftOrthSameTypeRule(toks[0]))
 #         parenRule.setParseAction(lambda string, loc, toks: toks[0])
         zeroOrMoreRule.setParseAction(lambda string, loc, toks: rules.ZeroOrMoreRule(toks[0]))
         oneOrMoreRule.setParseAction(lambda string, loc, toks: rules.ConcatRule([toks[0], rules.ZeroOrMoreRule(toks[0])]))
diff --git a/fsabuilder/morfeuszbuilder/tagset/segtypes.py b/fsabuilder/morfeuszbuilder/tagset/segtypes.py
index 24fd24d..f7f4bdc 100644
--- a/fsabuilder/morfeuszbuilder/tagset/segtypes.py
+++ b/fsabuilder/morfeuszbuilder/tagset/segtypes.py
@@ -26,6 +26,8 @@ class Segtypes(object):
         self._readTags(segrulesConfigFile)
         self._indexSegnums()
         
+        print self.segnum2Segtype
+        
     def _validate(self, msg, lineNum, cond):
         if not cond:
             raise exceptions.ConfigFileException(self.filename, lineNum, msg)
@@ -77,7 +79,7 @@ class Segtypes(object):
             
             lemma, pos = pattern.split(':')
             
-            self.patternsList.append(SegtypePattern(lemma, pos + ':%', segnum))
+            self.patternsList.append(SegtypePattern(lemma, '%s|%s:%%' % (pos, pos), segnum))
     
     def _debugSegnums(self):
         for tagnum, segnum in self._tagnum2Segnum.items():
diff --git a/input/segmenty.dat b/input/segmenty.dat
index a6bf109..6df8563 100644
--- a/input/segmenty.dat
+++ b/input/segmenty.dat
@@ -112,7 +112,7 @@ moze_interp(z_on_agl)
 moze_interp(z_on_agl on_agl)
 
 # Liczba zapisana jako ciąg cyfr:
-moze_interp( dig>* dig )
+moze_interp( dig!>+ )
 
 # Formacje prefiksalne
 #### trzeba wydzielić odpowiednie samodze!
diff --git a/input/segmenty1.dat b/input/segmenty1.dat
index 2dd3bba..228de14 100644
--- a/input/segmenty1.dat
+++ b/input/segmenty1.dat
@@ -7,7 +7,10 @@ praet=split composite
 
 #define moze_interp(segmenty) wsz_interp segmenty wsz_interp
 
-dig>* dig
+(adja dywiz)+ adj
+dig!>+
+dig!> dig!> dig!>
+naj> adj_sup
 
 [segment types]
 naj
diff --git a/morfeusz/FlexionGraph.cpp b/morfeusz/FlexionGraph.cpp
index 8d907b3..50063e6 100644
--- a/morfeusz/FlexionGraph.cpp
+++ b/morfeusz/FlexionGraph.cpp
@@ -35,18 +35,21 @@ void FlexionGraph::addPath(const std::vector<InterpretedChunk>& path) {
     //    debugGraph(this->graph);
     for (unsigned int i = 0; i < path.size(); i++) {
         const InterpretedChunk& chunk = path[i];
-        if (!chunk.shiftOrth) {
+        if (!chunk.orthWasShifted) {
             if (&chunk == &(path.front())
                     && &chunk == &(path.back())) {
                 Edge e = {chunk, UINT_MAX};
                 this->addStartEdge(e);
-            } else if (&chunk == &(path.front())) {
+            }
+            else if (&chunk == &(path.front())) {
                 Edge e = {chunk, this->graph.empty() ? 1 : (unsigned int) this->graph.size()};
                 this->addStartEdge(e);
-            } else if (&chunk == &(path.back())) {
+            }
+            else if (&chunk == &(path.back())) {
                 Edge e = {chunk, UINT_MAX};
                 this->addMiddleEdge((unsigned int) this->graph.size(), e);
-            } else {
+            }
+            else {
                 Edge e = {chunk, (int) this->graph.size() + 1};
                 this->addMiddleEdge((unsigned int) this->graph.size(), e);
             }
diff --git a/morfeusz/InterpretedChunk.hpp b/morfeusz/InterpretedChunk.hpp
index f10f138..2a51a10 100644
--- a/morfeusz/InterpretedChunk.hpp
+++ b/morfeusz/InterpretedChunk.hpp
@@ -17,6 +17,9 @@ struct InterpretedChunk {
     std::vector<uint32_t> lowercaseCodepoints;
     InterpsGroup interpsGroup;
     bool shiftOrth;
+    bool shiftOrthSameType;
+    bool orthWasShifted;
+    std::vector<InterpretedChunk> prefixChunks;
 };
 
 #endif	/* INTERPRETEDCHUNK_HPP */
diff --git a/morfeusz/InterpretedChunksDecoder.hpp b/morfeusz/InterpretedChunksDecoder.hpp
index 29b8c67..e91defe 100644
--- a/morfeusz/InterpretedChunksDecoder.hpp
+++ b/morfeusz/InterpretedChunksDecoder.hpp
@@ -29,10 +29,19 @@ public:
             unsigned int endNode,
             const InterpretedChunk& interpretedChunk,
             OutputIterator out) {
-        string orth = env.getCharsetConverter().toString(interpretedChunk.originalCodepoints);
+        string orth;
+        string lemmaPrefix;
+        for (unsigned int i = 0; i < interpretedChunk.prefixChunks.size(); i++) {
+            const InterpretedChunk& prefixChunk = interpretedChunk.prefixChunks[i];
+            orth += env.getCharsetConverter().toString(prefixChunk.originalCodepoints);
+            lemmaPrefix += convertLemma(
+                    prefixChunk.lowercaseCodepoints,
+                    prefixChunk.interpsGroup.interps[0].lemma);
+        }
+        orth += env.getCharsetConverter().toString(interpretedChunk.originalCodepoints);
         for (unsigned int i = 0; i < interpretedChunk.interpsGroup.interps.size(); i++) {
             const EncodedInterpretation& ei = interpretedChunk.interpsGroup.interps[i];
-            string lemma = convertLemma(
+            string lemma = lemmaPrefix + convertLemma(
                     interpretedChunk.lowercaseCodepoints,
                     ei.lemma);
             *out = MorphInterpretation(
diff --git a/morfeusz/Morfeusz.cpp b/morfeusz/Morfeusz.cpp
index 2b50b26..3fa9ed4 100644
--- a/morfeusz/Morfeusz.cpp
+++ b/morfeusz/Morfeusz.cpp
@@ -124,6 +124,15 @@ void Morfeusz::analyzeOneWord(
     inputStart = currInput;
 }
 
+static inline void doShiftOrth(InterpretedChunk& from, InterpretedChunk& to) {
+    to.prefixChunks.insert(
+        to.prefixChunks.begin(), 
+        from.prefixChunks.begin(), 
+        from.prefixChunks.end());
+    to.prefixChunks.push_back(from);
+    from.orthWasShifted = true;
+}
+
 void Morfeusz::doAnalyzeOneWord(
         const char*& inputData,
         const char* inputEnd,
@@ -150,18 +159,17 @@ void Morfeusz::doAnalyzeOneWord(
                 vector<InterpsGroup> val(state.getValue());
                 for (unsigned int i = 0; i < val.size(); i++) {
                     InterpsGroup& ig = val[i];
-
+                    cerr << (int) ig.type << endl;
                     SegrulesStateType newSegrulesState = segrulesState;
                     newSegrulesState.proceedToNext(ig.type);
                     if (!newSegrulesState.isSink()) {
-                        bool shiftOrth = newSegrulesState.getLastTransitionValue();
-                        InterpretedChunk ic = {inputData, originalCodepoints, lowercaseCodepoints, ig, shiftOrth};
-                        if (!accum.empty() && accum.back().shiftOrth) {
-                            ic.originalCodepoints.insert(
-                                    ic.originalCodepoints.begin(),
-                                    accum.back().originalCodepoints.begin(),
-                                    accum.back().originalCodepoints.end());
-                            ic.chunkStartPtr = accum.back().chunkStartPtr;
+                        bool shiftOrth = newSegrulesState.getLastTransitionValue() == 1;
+                        bool shiftOrthSameType = newSegrulesState.getLastTransitionValue() == 2;
+                        InterpretedChunk ic = {inputData, originalCodepoints, lowercaseCodepoints, ig, shiftOrth, shiftOrthSameType, false};
+                        if (!accum.empty() 
+                            && (accum.back().shiftOrth
+                                || (accum.back().shiftOrthSameType && accum.back().interpsGroup.type == ig.type))) {
+                            doShiftOrth(accum.back(), ic);
                         }
                         accum.push_back(ic);
                         const char* newCurrInput = currInput;
@@ -179,17 +187,17 @@ void Morfeusz::doAnalyzeOneWord(
         vector<InterpsGroup > val(state.getValue());
         for (unsigned int i = 0; i < val.size(); i++) {
             InterpsGroup& ig = val[i];
+            cerr << (int) ig.type << endl;
             SegrulesStateType newSegrulesState = segrulesState;
             newSegrulesState.proceedToNext(ig.type);
             if (newSegrulesState.isAccepting()) {
-                bool shiftOrth = newSegrulesState.getLastTransitionValue();
-                InterpretedChunk ic = {inputData, originalCodepoints, lowercaseCodepoints, ig, shiftOrth};
-                if (!accum.empty() && accum.back().shiftOrth) {
-                    ic.originalCodepoints.insert(
-                            ic.originalCodepoints.begin(),
-                            accum.back().originalCodepoints.begin(),
-                            accum.back().originalCodepoints.end());
-                    ic.chunkStartPtr = accum.back().chunkStartPtr;
+                bool shiftOrth = newSegrulesState.getLastTransitionValue() == 1;
+                bool shiftOrthSameType = newSegrulesState.getLastTransitionValue() == 2;
+                InterpretedChunk ic = {inputData, originalCodepoints, lowercaseCodepoints, ig, shiftOrth, shiftOrthSameType, false};
+                if (!accum.empty() 
+                            && (accum.back().shiftOrth 
+                                || (accum.back().shiftOrthSameType && accum.back().interpsGroup.type == ig.type))) {
+                    doShiftOrth(accum.back(), ic);
                 }
                 accum.push_back(ic);
                 graph.addPath(accum);
diff --git a/morfeusz/java/dupa b/morfeusz/java/dupa
new file mode 100644
index 0000000..a0fcd34
--- /dev/null
+++ b/morfeusz/java/dupa
@@ -0,0 +1,36 @@
+
+# SWIG
+#set(CMAKE_SWIG_OUTDIR swig)
+#FIND_PACKAGE(SWIG REQUIRED)
+FIND_PACKAGE(JNI REQUIRED)
+#INCLUDE(${SWIG_USE_FILE})
+include(UseJava)
+
+# SWIG Java
+include_directories (${JAVA_INCLUDE_PATH})
+include_directories (..)
+
+set (SWIG_JAVA_OUTFILE swigJAVA.cpp)
+# set (JAVA_WRAPPER_FILE ${CMAKE_SHARED_LIBRARY_PREFIX}morfeusz${CMAKE_SHARED_LIBRARY_SUFFIX})
+add_custom_command ( 
+    OUTPUT ${SWIG_JAVA_OUTFILE}
+    COMMAND swig -java -c++ -package pl.waw.ipipan.morfeusz  -o ${SWIG_JAVA_OUTFILE} -outdir ${CMAKE_SOURCE_DIR}/jmorfeusz/src/main/java/pl/waw/ipipan/morfeusz ${CMAKE_SOURCE_DIR}/morfeusz/morfeusz.i
+    DEPENDS libmorfeusz
+)
+#set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc")
+add_library (jmorfeusz SHARED ${SWIG_JAVA_OUTFILE})
+target_link_libraries (jmorfeusz ${JAVA_LIBRARIES} libmorfeusz)
+add_dependencies (jmorfeusz ${SWIG_JAVA_OUTFILE})
+
+#set (CMAKE_SWIG_FLAGS -package pl.waw.ipipan.morfeusz)
+#set (CMAKE_SWIG_OUTDIR ${CMAKE_SOURCE_DIR}/jmorfeusz/src/main/java/pl/waw/ipipan/morfeusz) 
+
+#set_source_files_properties (../morfeusz.i PROPERTIES CPLUSPLUS ON)
+#SWIG_ADD_MODULE(jmorfeusz java ../morfeusz.i)
+#SWIG_LINK_LIBRARIES(jmorfeusz ${JAVA_LIBRARIES})
+#SWIG_LINK_LIBRARIES(jmorfeusz libmorfeusz)
+
+#if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+#    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+#    set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc")
+#endif ()
diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml
index 9958790..a1925b9 100644
--- a/nbproject/configurations.xml
+++ b/nbproject/configurations.xml
@@ -10,6 +10,12 @@
     </logicalFolder>
     <logicalFolder name="f1" displayName="input" projectFiles="true">
     </logicalFolder>
+    <logicalFolder name="java"
+                   displayName="java"
+                   projectFiles="true"
+                   root="build1/morfeusz/java">
+      <itemPath>build1/morfeusz/java/swigJAVA.cpp</itemPath>
+    </logicalFolder>
     <df root="morfeusz" name="0">
       <df name="charset">
         <in>CaseConverter.cpp</in>
@@ -60,6 +66,10 @@
       <itemPath>build/morfeusz/morfeuszJAVA_wrap.cxx</itemPath>
       <itemPath>build/morfeusz/morfeuszPYTHON_wrap.cxx</itemPath>
     </logicalFolder>
+    <logicalFolder name="xxx" displayName="xxx" projectFiles="true" root="..">
+      <itemPath>../default_fsa.cpp</itemPath>
+      <itemPath>../default_synth_fsa.cpp</itemPath>
+    </logicalFolder>
     <logicalFolder name="ExternalFiles"
                    displayName="Important Files"
                    projectFiles="false"
@@ -95,6 +105,10 @@
           <executablePath>build/morfeusz/morfeusz_analyzer</executablePath>
         </makeTool>
       </makefileType>
+      <item path="../default_fsa.cpp" ex="false" tool="1" flavor2="4">
+      </item>
+      <item path="../default_synth_fsa.cpp" ex="false" tool="1" flavor2="4">
+      </item>
       <item path="build/default_fsa.cpp" ex="false" tool="1" flavor2="4">
       </item>
       <item path="build/default_synth_fsa.cpp" ex="false" tool="1" flavor2="4">
@@ -107,6 +121,7 @@
             flavor2="8">
         <ccTool>
           <incDir>
+            <pElem>build</pElem>
             <pElem>/usr/lib/jvm/default-java/include</pElem>
             <pElem>morfeusz</pElem>
             <pElem>build/morfeusz/java</pElem>
@@ -130,6 +145,7 @@
             flavor2="8">
         <ccTool>
           <incDir>
+            <pElem>build</pElem>
             <pElem>/usr/include/python2.7</pElem>
             <pElem>morfeusz</pElem>
             <pElem>build/morfeusz/python</pElem>
@@ -152,11 +168,14 @@
             tool="1"
             flavor2="4">
       </item>
+      <item path="build1/morfeusz/java/swigJAVA.cpp" ex="false" tool="1" flavor2="4">
+      </item>
       <item path="default_fsa.cpp" ex="false" tool="1" flavor2="4">
         <ccTool flags="1">
           <incDir>
+            <pElem>build1</pElem>
             <pElem>morfeusz</pElem>
-            <pElem>build/morfeusz</pElem>
+            <pElem>build1/morfeusz</pElem>
           </incDir>
           <preprocessorList>
             <Elem>libmorfeusz_EXPORTS</Elem>
@@ -166,8 +185,9 @@
       <item path="default_synth_fsa.cpp" ex="false" tool="1" flavor2="4">
         <ccTool flags="1">
           <incDir>
+            <pElem>build1</pElem>
             <pElem>morfeusz</pElem>
-            <pElem>build/morfeusz</pElem>
+            <pElem>build1/morfeusz</pElem>
           </incDir>
           <preprocessorList>
             <Elem>libmorfeusz_EXPORTS</Elem>
@@ -234,18 +254,24 @@
           </undefinedList>
         </ccTool>
       </folder>
-      <folder path="morfeusz">
+      <folder path="java">
         <ccTool>
           <incDir>
-            <pElem>build</pElem>
+            <pElem>build1</pElem>
+            <pElem>morfeusz</pElem>
+            <pElem>/usr/lib/jvm/java-6-openjdk/include</pElem>
           </incDir>
+          <preprocessorList>
+            <Elem>libjmorfeusz_EXPORTS</Elem>
+          </preprocessorList>
         </ccTool>
       </folder>
       <folder path="morfeusz/java">
         <ccTool>
           <incDir>
+            <pElem>build</pElem>
             <pElem>morfeusz</pElem>
-            <pElem>/usr/lib/jvm/default-java/include</pElem>
+            <pElem>/usr/lib/jvm/java-6-openjdk/include</pElem>
           </incDir>
           <preprocessorList>
             <Elem>libjmorfeusz_EXPORTS</Elem>
@@ -255,6 +281,7 @@
       <folder path="morfeusz/python">
         <ccTool>
           <incDir>
+            <pElem>build</pElem>
             <pElem>/usr/include/python2.7</pElem>
             <pElem>morfeusz</pElem>
           </incDir>
@@ -271,6 +298,18 @@
           </undefinedList>
         </ccTool>
       </folder>
+      <folder path="xxx">
+        <ccTool>
+          <incDir>
+            <pElem>build</pElem>
+            <pElem>morfeusz</pElem>
+            <pElem>build/morfeusz</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>libmorfeusz_EXPORTS</Elem>
+          </preprocessorList>
+        </ccTool>
+      </folder>
       <item path="morfeusz/Environment.cpp" ex="false" tool="1" flavor2="4">
         <ccTool flags="1">
           <incDir>
@@ -368,26 +407,18 @@
         </ccTool>
       </item>
       <item path="morfeusz/charset/CaseConverter.cpp" ex="false" tool="1" flavor2="4">
-        <ccTool flags="1">
-        </ccTool>
       </item>
       <item path="morfeusz/charset/CharsetConverter.cpp"
             ex="false"
             tool="1"
             flavor2="4">
-        <ccTool flags="1">
-        </ccTool>
       </item>
       <item path="morfeusz/charset/caseconv.cpp" ex="false" tool="1" flavor2="4">
-        <ccTool flags="1">
-        </ccTool>
       </item>
       <item path="morfeusz/charset/conversion_tables.cpp"
             ex="false"
             tool="1"
             flavor2="4">
-        <ccTool flags="1">
-        </ccTool>
       </item>
       <item path="morfeusz/const.cpp" ex="false" tool="1" flavor2="4">
         <ccTool flags="1">
@@ -476,12 +507,8 @@
             ex="false"
             tool="1"
             flavor2="4">
-        <ccTool flags="1">
-        </ccTool>
       </item>
       <item path="morfeusz/segrules/segrules.cpp" ex="false" tool="1" flavor2="4">
-        <ccTool flags="1">
-        </ccTool>
       </item>
       <item path="morfeusz/test_recognize_dict.cpp" ex="false" tool="1" flavor2="4">
         <ccTool flags="0">
--
libgit2 0.22.2