2424#
2525# ================================================================
2626
27+ # the generic tagger
28+ TAGGER_IMPL = collins
29+
30+ # the generic depparser
31+ DEPPARSER_IMPL = arceager
32+
33+ # the generic conparser
34+ CONPARSER_IMPL = srnew
35+
2736# choose between agenda, agendachart etc ## NO SPACE AFTER NAME ###
2837#
2938# agenda: the single agenda method - reproduce paper
@@ -48,18 +57,33 @@ CHINESE_DEPPARSER_LABELED = true
4857CHINESE_DEPLABELER_IMPL = naive
4958
5059# currently support sr implementations
51- CHINESE_CONPARSER_IMPL = jcad
60+ CHINESE_CONPARSER_IMPL = acl13
61+ CHINESE_CONPARSER_JOINT_OR_CASCADE = JOINT_CONPARSER
5262
5363# currently support only agenda
5464ENGLISH_TAGGER_IMPL = collins
5565
5666# currently support eisner, covington, nivre, combined implementations
57- ENGLISH_DEPPARSER_IMPL =arceager
67+ ENGLISH_DEPPARSER_IMPL = arceager
5868ENGLISH_DEPPARSER_LABELED = true
5969ENGLISH_DEPLABELER_IMPL = naive
70+
6071# currently support sr implementations
6172ENGLISH_CONPARSER_IMPL = muhua
6273
74+ # Spanish pos tagger
75+ SPANISH_TAGGER_IMPL = collins
76+
77+ # Spanish dependency parser
78+ SPANISH_DEPPARSER_IMPL = arceager
79+ SPANISH_DEPPARSER_LABELED = true
80+ SPANISH_DEPLABELER_IMPL = naive
81+
82+ # Spanish annotation. Supported: ES06_DEPENDENCIES, ES09_DEPENDENCIES
83+ SPANISH_ANNOTATION = ES09_DEPENDENCIES
84+
85+ # no Spanish constituency parser at the moment
86+
6387# ================================================================
6488#
6589# Debug mode or the run mode (empty)
@@ -78,6 +102,19 @@ DEBUG = -DNDEBUG
78102BASE_DIR = .
79103include Makefile.common
80104
105+ # ================================================================
106+ #
107+ # cross platform configurations
108+ #
109+ # ================================================================
110+
111+ ifeq ($(OS ) ,Windows_NT)
112+ # use good old GNU mkdir instead of MSDOS mkdir on Windows
113+ MKDIR =gmkdir -p
114+ else
115+ MKDIR =mkdir -p
116+ endif
117+
81118# ================================================================
82119#
83120# compiler commands
@@ -100,37 +137,47 @@ LDFLAGS =
100137
101138# the objects
102139LINGUISTICS_OBJECTS = $(OBJECT_DIR ) /linguistics/lemma.o $(OBJECT_DIR ) /linguistics/conll.o
103- OBJECTS = $(OBJECT_DIR ) /reader.o $(OBJECT_DIR ) /writer.o $(OBJECT_DIR ) /options.o $(LINGUISTICS_OBJECTS )
140+ LEARNING_OBJECTS = $(OBJECT_DIR ) /learning/dbn.o
141+ OBJECTS = $(OBJECT_DIR ) /reader.o $(OBJECT_DIR ) /writer.o $(OBJECT_DIR ) /options.o $(LINGUISTICS_OBJECTS ) $(LEARNING_OBJECTS )
104142
105143$(OBJECT_DIR ) /% .o : $(SRC_LIBS ) /% .cpp $(SRC_INCLUDES ) /% .h
106- mkdir -p $(OBJECT_DIR )
107- mkdir -p $(OBJECT_DIR ) /linguistics
144+ $(MKDIR ) $(OBJECT_DIR )
145+ $(MKDIR ) $(OBJECT_DIR ) /linguistics
146+ $(MKDIR ) $(OBJECT_DIR ) /learning
108147$(CXX ) $(CXXFLAGS ) -c $< -o $@
109148
110149all : zpar
111150
112151# the directories
113152$(OBJECT_DIR ) :
114- mkdir -p $(OBJECT_DIR )
153+ $( MKDIR ) $(OBJECT_DIR )
115154$(DIST_DIR ) :
116- mkdir -p $(DIST_DIR )
155+ $( MKDIR ) $(DIST_DIR )
117156
118157# tagger
119158SRC_TAGGER = $(SRC_CHINESE ) /tagger
120159DIST_TAGGER = $(DIST_DIR ) /chinese.postagger
121160OBJECT_TAGGER = $(OBJECT_DIR ) /chinese.postagger
122161$(DIST_TAGGER ) :
123- mkdir $(DIST_TAGGER )
162+ $( MKDIR ) $(DIST_TAGGER )
124163$(OBJECT_TAGGER ) :
125- mkdir $(OBJECT_TAGGER )
164+ $( MKDIR ) $(OBJECT_TAGGER )
126165
127166SRC_ENGLISH_TAGGER = $(SRC_COMMON ) /tagger
128167DIST_ENGLISH_TAGGER = $(DIST_DIR ) /english.postagger
129168OBJECT_ENGLISH_TAGGER = $(OBJECT_DIR ) /english.postagger
130169$(DIST_ENGLISH_TAGGER ) :
131- mkdir $(DIST_ENGLISH_TAGGER )
170+ $( MKDIR ) $(DIST_ENGLISH_TAGGER )
132171$(OBJECT_ENGLISH_TAGGER ) :
133- mkdir $(OBJECT_ENGLISH_TAGGER )
172+ $(MKDIR ) $(OBJECT_ENGLISH_TAGGER )
173+
174+ SRC_SPANISH_TAGGER = $(SRC_COMMON ) /tagger
175+ DIST_SPANISH_TAGGER = $(DIST_DIR ) /spanish.postagger
176+ OBJECT_SPANISH_TAGGER = $(OBJECT_DIR ) /spanish.postagger
177+ $(DIST_SPANISH_TAGGER ) :
178+ $(MKDIR ) $(DIST_SPANISH_TAGGER )
179+ $(OBJECT_SPANISH_TAGGER ) :
180+ $(MKDIR ) $(OBJECT_SPANISH_TAGGER )
134181
135182# depparser
136183SRC_COMMON_DEPPARSER = $(SRC_COMMON ) /depparser
@@ -144,6 +191,8 @@ DIST_DEPPARSER = $(DIST_DIR)/chinese.depparser
144191OBJECT_DEPPARSER = $(OBJECT_DIR ) /chinese.depparser
145192DIST_ENGLISH_DEPPARSER = $(DIST_DIR ) /english.depparser
146193OBJECT_ENGLISH_DEPPARSER = $(OBJECT_DIR ) /english.depparser
194+ DIST_SPANISH_DEPPARSER = $(DIST_DIR ) /spanish.depparser
195+ OBJECT_SPANISH_DEPPARSER = $(OBJECT_DIR ) /spanish.depparser
147196
148197# deplabeler
149198SRC_COMMON_DEPLABELER = $(SRC_COMMON ) /deplabeler
@@ -153,14 +202,21 @@ OBJECT_DEPLABELER = $(OBJECT_DIR)/chinese.deplabeler
153202SRC_ENGLISH_DEPLABELER = $(SRC_COMMON_DEPLABELER )
154203DIST_ENGLISH_DEPLABELER = $(DIST_DIR ) /english.deplabeler
155204OBJECT_ENGLISH_DEPLABELER = $(OBJECT_DIR ) /english.deplabeler
205+ SRC_SPANISH_DEPLABELER = $(SRC_COMMON_DEPLABELER )
206+ DIST_SPANISH_DEPLABELER = $(DIST_DIR ) /spanish.deplabeler
207+ OBJECT_SPANISH_DEPLABELER = $(OBJECT_DIR ) /spanish.deplabeler
156208
157209# conparser
158210SRC_COMMON_CONPARSER = $(SRC_COMMON ) /conparser
159211SRC_CHINESE_CONPARSER = $(SRC_COMMON_CONPARSER )
160212ifeq ($(CHINESE_CONPARSER_IMPL ) , jcad)
161213SRC_CHINESE_CONPARSER = $(SRC_CHINESE)/conparser
162214else
163- SRC_CHINESE_CONPARSER = $(SRC_COMMON_CONPARSER)
215+ ifeq ($(CHINESE_CONPARSER_IMPL), acl13)
216+ SRC_CHINESE_CONPARSER = $(SRC_CHINESE)/conparser
217+ else
218+ SRC_CHINESE_CONPARSER = $(SRC_COMMON_CONPARSER)
219+ endif
164220endif
165221SRC_ENGLISH_CONPARSER = $(SRC_COMMON_CONPARSER )
166222DIST_CONPARSER = $(DIST_DIR ) /chinese.conparser
@@ -174,51 +230,88 @@ OBJECT_ENGLISH_CONPARSER = $(OBJECT_DIR)/english.conparser
174230#
175231# ----------------------------------------------------------------
176232
177- include Makefile.zpar
178- include Makefile.zpar.en
179- include Makefile.zpar.ge
180- include Makefile.lib.zpar
181233
182- # ----------------------------------------------------------------
183- #
184- # The sentence boundary detector
185- #
186- # ----------------------------------------------------------------
234+ ifeq ($(CHINESE_CONPARSER_IMPL ) , jcad)
235+ OBJ_CHINESE_CONSTITUENT = $(OBJECT_CONPARSER)/constituent.o $(OBJECT_CONPARSER)/jointconstituent.o
236+ else
237+ ifeq ($(CHINESE_CONPARSER_IMPL), acl13)
238+ OBJ_CHINESE_CONSTITUENT = $(OBJECT_CONPARSER)/constituent.o $(OBJECT_CONPARSER)/jointconstituent.o
239+ else
240+ OBJ_CHINESE_CONSTITUENT = $(OBJECT_CONPARSER)/constituent.o
241+ endif
242+ endif
187243
188- include Makefile.doc2snt
244+ $(DIST_CONPARSER ) :
245+ $(MKDIR ) $(DIST_CONPARSER )
246+ $(OBJECT_CONPARSER ) :
247+ $(MKDIR ) $(OBJECT_CONPARSER )
189248
190- # ----------------------------------------------------------------
191- #
192- # The segmentor
193- #
194- # ----------------------------------------------------------------
249+ $(DIST_DEPLABELER ) :
250+ $(MKDIR ) $(DIST_DEPLABELER )
251+ $(OBJECT_DEPLABELER ) :
252+ $(MKDIR ) $(OBJECT_DEPLABELER )
195253
196- include Makefile.segmentor
254+ # the flags for train
255+ ifeq ($(CHINESE_TAGGER_IMPL ) , segmented) # if segmented
256+ TAGGER_TRAIN_FLAGS = -DSEGMENTED
257+ TAGGER_TEST_FLAGS = -DSEGMENTED
258+ else
259+ ifeq ($(CHINESE_TAGGER_IMPL), bidirectional) # else if bidirectional
260+ TAGGER_TRAIN_FLAGS = -DSEGMENTED -DAUTO
261+ TAGGER_TEST_FLAGS = -DSEGMENTED
262+ endif
263+ endif
197264
198- # ----------------------------------------------------------------
199- #
200- # The pos taggers (Chinese and English)
201- #
202- # ----------------------------------------------------------------
203265
204- include Makefile.postagger
266+ ifeq ($(CHINESE_DEPPARSER_LABELED ) , true)
267+ CHINESE_DEPPARSER_D = -DLABELED
268+ endif
205269
206- # ----------------------------------------------------------------
207- #
208- # The depparsers (Chinese and English)
209- #
210- # ----------------------------------------------------------------
270+ ifeq ($(ENGLISH_DEPPARSER_LABELED ) , true)
271+ ENGLISH_DEPPARSER_D = -DLABELED
272+ endif
273+
274+ ifeq ($(CHINESE_DEPPARSER_IMPL ) , combined)
275+ CHINESE_DEPPARSER_D := $(CHINESE_DEPPARSER_D) -DCOMBINED
276+ CHINESE_DEPPARSER_IMPL = nivre
277+ endif
278+
279+ ifeq ($(ENGLISH_DEPPARSER_IMPL ) , combined)
280+ ENGLISH_DEPPARSER_D := $(ENGLISH_DEPPARSER_D) -DCOMBINED
281+ ENGLISH_DEPPARSER_IMPL = nivre
282+ endif
283+
284+ # ====================================================
285+
286+ $(DIST_DEPPARSER ) :
287+ $(MKDIR ) $(DIST_DEPPARSER )
288+ $(OBJECT_DEPPARSER ) :
289+ $(MKDIR ) $(OBJECT_DEPPARSER )
211290
212- include Makefile.depparser
213- include Makefile.deplabeler
291+ SRC_SEGMENTOR = $(SRC_CHINESE ) /segmentor
292+ DIST_SEGMENTOR = $(DIST_DIR ) /segmentor
293+ OBJECT_SEGMENTOR = $(OBJECT_DIR ) /segmentor
294+ $(DIST_SEGMENTOR ) :
295+ $(MKDIR ) $(DIST_SEGMENTOR )
296+ $(OBJECT_SEGMENTOR ) :
297+ $(MKDIR ) $(OBJECT_SEGMENTOR )
298+
299+ include Makefile.zpar.zh
300+ include Makefile.zpar.en
301+ include Makefile.zpar.ge
302+ include Makefile.zpar.es
303+ include Makefile.zpar.mvt
304+ include Makefile.lib.zpar
305+
306+ zpar : zpar.ge
214307
215308# ----------------------------------------------------------------
216309#
217- # The conparser
310+ # The sentence boundary detector
218311#
219312# ----------------------------------------------------------------
220313
221- include Makefile.conparser
314+ include Makefile.doc2snt
222315
223316# ----------------------------------------------------------------
224317#
0 commit comments