[frog] 100/103: Imported Upstream version 0.12.17

Joost van Baal joostvb at moszumanska.debian.org
Wed Sep 3 17:12:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

joostvb pushed a commit to branch master
in repository frog.

commit 9c64dd15d4c1e48fcc6e2eb5dd75ba73450bfc70
Author: Joost van Baal-Ilić <joostvb at nusku.mdcc.cx>
Date:   Wed Sep 3 18:57:39 2014 +0200

    Imported Upstream version 0.12.17
---
 AUTHORS                              |  19 +-
 ChangeLog                            | 489 ++++++++++++++++++++++++++
 INSTALL                              |   9 +-
 Makefile.in                          |  77 +++--
 NEWS                                 |  13 +
 README                               |  69 ++--
 aclocal.m4                           | 101 +++---
 bootstrap                            |  14 +-
 config.guess                         |  49 ++-
 config.h.in                          |  12 +-
 config.sub                           |  65 ++--
 configure                            | 448 +++++++++++++++---------
 configure.ac                         |  37 +-
 depcomp                              |  74 +++-
 docs/Makefile.am                     |   6 +-
 docs/Makefile.in                     |  48 +--
 docs/frog-dp-update.1                |  29 --
 docs/frog.1                          |  26 +-
 docs/mblem.1                         |  48 +++
 docs/mbma.1                          |  48 +++
 include/Makefile.am                  |   2 +-
 include/Makefile.in                  |  34 +-
 include/frog/Configuration.h         |  50 ---
 include/frog/Frog.h                  |  47 +--
 include/frog/Makefile.am             |   2 +-
 include/frog/Makefile.in             |  44 ++-
 include/frog/Parser.h                |  15 +-
 include/frog/cgn_tagger_mod.h        |  11 +-
 include/frog/iob_tagger_mod.h        |  13 +-
 include/frog/mblem_mod.h             |  19 +-
 include/frog/mbma_mod.h              |  35 +-
 include/frog/mwu_chunker_mod.h       |  14 +-
 include/frog/ner_tagger_mod.h        |  13 +-
 include/frog/ucto_tokenizer_mod.h    |  18 +-
 ltmain.sh                            |  95 +++---
 m4/Makefile.am                       |   2 +-
 m4/Makefile.in                       |  34 +-
 m4/ac_define_dir.m4                  |  45 ---
 m4/{acx_pthread.m4 => ax_pthread.m4} | 115 ++++---
 m4/ltversion.m4                      |  10 +-
 m4/pkg.m4                            |  10 +-
 missing                              |  53 +--
 py-compile                           |  51 ++-
 scripts/Makefile.am                  |   2 +-
 scripts/Makefile.in                  |  60 ++--
 src/Configuration.cxx                | 261 --------------
 src/Frog-util.cxx                    |  36 +-
 src/Frog.cxx                         | 339 +++++++++++++------
 src/Makefile.am                      |  21 +-
 src/Makefile.in                      | 240 +++++++------
 src/Parser.cxx                       | 152 +++++----
 src/cgn_tagger_mod.cxx               |  55 ++-
 src/frog-dp-update                   |  61 ----
 src/iob_tagger_mod.cxx               |  48 +--
 src/mblem_mod.cxx                    | 241 ++++++-------
 src/mblem_prog.cxx                   | 225 ++++++++++++
 src/mbma_mod.cxx                     | 640 +++++++++++++++++++++++------------
 src/mbma_prog.cxx                    | 222 ++++++++++++
 src/mwu_chunker_mod.cxx              |  33 +-
 src/ner_tagger_mod.cxx               |  44 +--
 src/ucto_tokenizer_mod.cxx           |  50 ++-
 tests/Makefile.in                    |  32 +-
 62 files changed, 3311 insertions(+), 1864 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index ca1dfa8..28bc86d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,20 +1,29 @@
 Authors:
 
-People that wrote and rewrote the Frog code, starting from 0.1
+People who wrote and rewrote the Frog code, starting from 0.1
 
-Berjan Busser
+Bertjan Busser
 Antal van den Bosch
 Maarten van Gompel
 Ko van der Sloot
 
 Contributors:
 
-People that contributed to Frog by suggesting improvements, 
-filing bug reports, asking the right questions etc.
+People who contributed code for NLP modules that found
+their way into Frog:
+
+Sander Canisius (CSI-DP)
+Jakub Zavrel (MBT)
+
+People who contributed to Frog by suggesting improvements, 
+filing bug reports, asking the right questions etc.:
 
 Walter Daelemans
+Micha Hulsbosch
+Emmanuel Keuleers
 Martin Reynaart
 Frederik Vaassen
-and many others
+
+and many others.
 
 
diff --git a/ChangeLog b/ChangeLog
index f1e78df..4b6bfbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,492 @@
+2013-04-03 13:15  sloot
+
+	* [r15906] NEWS, configure.ac: NEWS
+
+2013-04-02 16:10  sloot
+
+	* [r15886] configure.ac: we need the most recent ticcutils
+
+2013-04-02 15:57  sloot
+
+	* [r15877] include/frog/Frog.h, include/frog/mwu_chunker_mod.h,
+	  include/frog/ucto_tokenizer_mod.h, src/Frog.cxx, src/Parser.cxx,
+	  src/cgn_tagger_mod.cxx, src/iob_tagger_mod.cxx,
+	  src/mblem_mod.cxx, src/mblem_prog.cxx, src/mbma_mod.cxx,
+	  src/mbma_prog.cxx, src/mwu_chunker_mod.cxx,
+	  src/ner_tagger_mod.cxx: adapted to changed folia include path
+
+2013-04-02 09:49  sloot
+
+	* [r15857] include/frog/Frog.h, src/Frog.cxx, src/Parser.cxx: Timer
+	  class was moved to ticcutils
+
+2013-03-28 17:44  sloot
+
+	* [r15847] src/cgn_tagger_mod.cxx, src/iob_tagger_mod.cxx,
+	  src/ner_tagger_mod.cxx: some stuff is moved from libfolia to
+	  ticcutils
+
+2013-03-28 12:10  sloot
+
+	* [r15833] src/Frog.cxx, src/Parser.cxx, src/mblem_mod.cxx,
+	  src/mblem_prog.cxx, src/mbma_mod.cxx, src/mbma_prog.cxx,
+	  src/mwu_chunker_mod.cxx, src/ucto_tokenizer_mod.cxx: adapted to
+	  changed ticcutils
+
+2013-03-28 10:25  sloot
+
+	* [r15826] docs/frog.1, src/Frog.cxx: added a --threads option, so
+	  we can limit the number of theads now.
+
+2013-03-25 16:35  sloot
+
+	* [r15812] src/cgn_tagger_mod.cxx: replace SPEC() tags by LET()
+	  when the tokenizer thinks that its PUNCTUAION
+
+2013-03-06 13:09  sloot
+
+	* [r15770] src/Frog.cxx: fixed program logic
+
+2013-03-06 11:23  sloot
+
+	* [r15767] docs/frog.1, include/frog/ucto_tokenizer_mod.h,
+	  src/Frog.cxx, src/ucto_tokenizer_mod.cxx: added a textclass
+	  option for the tokenizer
+
+2013-02-21 14:57  sloot
+
+	* [r15694] NEWS, configure.ac, src/ucto_tokenizer_mod.cxx: it seems
+	  passthru was not hounourd. Sometimes
+
+2013-02-07 16:13  sloot
+
+	* [r15650] include/frog/mblem_mod.h, src/mblem_mod.cxx: no longer
+	  assign identical lemma's
+
+2013-01-07 14:59  sloot
+
+	* [r15572] include/frog/Frog.h, include/frog/Parser.h,
+	  include/frog/cgn_tagger_mod.h, include/frog/iob_tagger_mod.h,
+	  include/frog/mblem_mod.h, include/frog/mbma_mod.h,
+	  include/frog/mwu_chunker_mod.h, include/frog/ner_tagger_mod.h,
+	  include/frog/ucto_tokenizer_mod.h, src/Frog-util.cxx,
+	  src/Frog.cxx, src/Parser.cxx, src/cgn_tagger_mod.cxx,
+	  src/iob_tagger_mod.cxx, src/mblem_mod.cxx, src/mblem_prog.cxx,
+	  src/mbma_mod.cxx, src/mbma_prog.cxx, src/mwu_chunker_mod.cxx,
+	  src/ner_tagger_mod.cxx, src/ucto_tokenizer_mod.cxx: Bunp year
+
+2013-01-07 12:54  sloot
+
+	* [r15562] docs/frog.1: adapted man page
+
+2012-12-19 13:12  sloot
+
+	* [r15546] include/frog/Frog.h, src/Frog-util.cxx, src/Frog.cxx:
+	  when handling xml input from a directory, only '.xml' files are
+	  handled
+
+2012-12-19 11:46  sloot
+
+	* [r15544] docs/frog.1, src/Frog.cxx: added more options to --skip:
+	  a for MBMA and l for MBLEM
+
+2012-12-11 15:37  sloot
+
+	* [r15535] src/Frog.cxx, src/cgn_tagger_mod.cxx: improved handling
+	  of some exceptions.
+
+2012-12-11 14:27  sloot
+
+	* [r15534] include/frog/Parser.h, include/frog/mblem_mod.h,
+	  include/frog/mbma_mod.h, src/Frog.cxx, src/Parser.cxx,
+	  src/mblem_mod.cxx, src/mbma_mod.cxx, src/mwu_chunker_mod.cxx:
+	  attempt to be more robus when multiple POS annotations are
+	  available. MWU is unclear
+
+2012-12-05 17:06  sloot
+
+	* [r15523] src/cgn_tagger_mod.cxx: added debug line
+
+2012-12-05 16:11  sloot
+
+	* [r15521] include/frog/Frog.h, src/Frog-util.cxx,
+	  src/cgn_tagger_mod.cxx, src/iob_tagger_mod.cxx,
+	  src/mblem_mod.cxx, src/mbma_mod.cxx, src/mwu_chunker_mod.cxx,
+	  src/ner_tagger_mod.cxx: add datetime attribute to annotation
+	  definitions
+
+2012-11-26 14:58  sloot
+
+	* [r15470] src/Frog.cxx, src/mblem_prog.cxx, src/mbma_prog.cxx: the
+	  configuration.set() function is renamed to setatt()
+
+2012-11-21 16:33  sloot
+
+	* [r15454] include/frog/Configuration.h, include/frog/Frog.h,
+	  include/frog/Makefile.am, include/frog/Parser.h,
+	  include/frog/cgn_tagger_mod.h, include/frog/iob_tagger_mod.h,
+	  include/frog/mblem_mod.h, include/frog/mbma_mod.h,
+	  include/frog/mwu_chunker_mod.h, include/frog/ner_tagger_mod.h,
+	  include/frog/ucto_tokenizer_mod.h, src/Configuration.cxx,
+	  src/Frog.cxx, src/Makefile.am, src/Parser.cxx, src/mblem_mod.cxx,
+	  src/mblem_prog.cxx, src/mbma_mod.cxx, src/mbma_prog.cxx,
+	  src/ucto_tokenizer_mod.cxx: use Configuration stuff provided by
+	  ticcutils
+
+2012-11-13 11:45  sloot
+
+	* [r15422] src/cgn_tagger_mod.cxx, src/iob_tagger_mod.cxx,
+	  src/ner_tagger_mod.cxx: better handle init errors
+
+2012-11-12 11:19  sloot
+
+	* [r15415] configure.ac: ARGHG!!!!
+
+2012-11-01 16:07  sloot
+
+	* [r15400] src/cgn_tagger_mod.cxx: REVERSE-SMILEY is a symbol too
+
+2012-10-31 15:55  sloot
+
+	* [r15381] src/mbma_mod.cxx: small change in adding Alternative:
+	  now NO id is generated. why should we.
+
+2012-10-30 12:37  mvgompel
+
+	* [r15362] bootstrap: bootstrap fix (matched failed on automake
+	  1.11.6 with Ubuntu 12.10)
+
+2012-10-29 13:44  sloot
+
+	* [r15345] include/frog/mbma_mod.h, src/mbma_mod.cxx: multiple
+	  morphs must be placed in alternatives
+
+2012-10-02 11:56  sloot
+
+	* [r15242] src/Frog.cxx, src/Parser.cxx: adapted to most recent
+	  FoLiA idea's
+
+2012-09-13 08:19  sloot
+
+	* [r15182] docs/frog.1: added missing info
+
+2012-09-12 12:00  sloot
+
+	* [r15176] docs/frog-dp-update.1: not needed anymore
+
+2012-09-12 11:03  sloot
+
+	* [r15175] NEWS: news
+
+2012-09-12 11:03  sloot
+
+	* [r15174] src/Frog.cxx: honour the -n option for servermode
+	  (non-XML) too
+	  requires EOT marker at the end of transmission.
+
+2012-08-09 13:16  sloot
+
+	* [r15093] src/Configuration.cxx, src/Frog.cxx, src/Parser.cxx,
+	  src/cgn_tagger_mod.cxx, src/iob_tagger_mod.cxx,
+	  src/mbma_prog.cxx, src/ner_tagger_mod.cxx: more TiCC utils
+
+2012-08-08 09:22  sloot
+
+	* [r15064] include/frog/Frog.h, include/frog/Parser.h,
+	  include/frog/mblem_mod.h, include/frog/mbma_mod.h,
+	  include/frog/mwu_chunker_mod.h,
+	  include/frog/ucto_tokenizer_mod.h, src/Parser.cxx,
+	  src/mblem_mod.cxx, src/mbma_mod.cxx, src/mwu_chunker_mod.cxx,
+	  src/ucto_tokenizer_mod.cxx: LogStream in TiCC namespace
+
+2012-08-07 15:58  sloot
+
+	* [r15055] src/ucto_tokenizer_mod.cxx: smaal edit
+
+2012-08-07 15:48  sloot
+
+	* [r15054] configure.ac, include/frog/Frog.h, src/Frog.cxx,
+	  src/mblem_prog.cxx, src/mbma_prog.cxx: fix
+
+2012-07-31 12:33  sloot
+
+	* [r15017] include/frog/ucto_tokenizer_mod.h, src/Frog.cxx,
+	  src/ucto_tokenizer_mod.cxx: added a --uttmarker option.
+
+2012-07-23 10:57  sloot
+
+	* [r15002] src/mblem_mod.cxx: removed unneeded dependency
+
+2012-07-12 15:04  sloot
+
+	* [r14981] src/Frog.cxx: finshed merging new 'quote' scenario.
+
+2012-07-12 15:00  sloot
+
+	* [r14980] configure.ac, src/Frog.cxx, src/iob_tagger_mod.cxx,
+	  src/mblem_mod.cxx, src/mbma_mod.cxx: start merging 'quote' branch
+
+2012-07-09 14:51  sloot
+
+	* [r14969] include/frog/mblem_mod.h, include/frog/mbma_mod.h,
+	  src/Frog.cxx, src/Parser.cxx, src/mblem_mod.cxx,
+	  src/mbma_mod.cxx, src/mwu_chunker_mod.cxx: some small refactoring
+	  to get things more in line
+
+2012-07-04 15:02  sloot
+
+	* [r14957] include/frog/Parser.h, include/frog/mwu_chunker_mod.h,
+	  src/Frog.cxx, src/Parser.cxx, src/mwu_chunker_mod.cxx: finished
+	  refactoring for now
+
+2012-07-04 14:38  sloot
+
+	* [r14956] include/frog/cgn_tagger_mod.h,
+	  include/frog/iob_tagger_mod.h, include/frog/ner_tagger_mod.h,
+	  src/Frog.cxx, src/cgn_tagger_mod.cxx, src/iob_tagger_mod.cxx,
+	  src/ner_tagger_mod.cxx: refactoring (not doem yet)
+	  let all modules work on Word * sequences. So abstract form
+	  Sentences a bit.
+
+2012-07-04 13:47  sloot
+
+	* [r14954] src/Frog.cxx: oesp
+
+2012-07-04 13:15  sloot
+
+	* [r14952] src/Frog.cxx: oesp. display warning only when need to
+
+2012-07-04 13:08  sloot
+
+	* [r14951] src/Frog.cxx: small refactoring. for better
+	  understanding
+
+2012-07-02 12:21  joostvb
+
+	* [r14942] README: ma 02 14:10 < Kobus> less flux tegenwoordig
+	  ma 02 14:10 < Kobus> pre-beta wel
+	  ma 02 14:10 < Kobus> beta
+	  ma 02 14:13 < Kobus> alles wat we wilden zit er nu in, en is
+	  getest
+	  ma 02 14:20 < Kobus> Named Entity Recognition ook
+	  ma 02 14:20 < Kobus> en Chunking
+	  ma 02 14:20 < Kobus> maar prima hoor
+
+2012-07-02 12:18  joostvb
+
+	* [r14941] README: update blurb on status of this software
+
+2012-07-02 12:16  joostvb
+
+	* [r14940] README: layout, s/de/the/
+
+2012-06-27 10:24  sloot
+
+	* [r14932] docs/Makefile.am, docs/mblem.1, docs/mbma.1: add simple
+	  man pages for mbma and mblem
+
+2012-06-27 10:10  sloot
+
+	* [r14931] src/mbma_mod.cxx: some cleanup, and comment added.
+
+2012-06-26 15:30  sloot
+
+	* [r14930] src/mbma_mod.cxx: better debug lines
+	  choke on a "PE" tag. Let's see if it ever happens.
+
+2012-06-26 14:35  sloot
+
+	* [r14929] src/mbma_mod.cxx: better debug info
+
+2012-06-26 12:50  sloot
+
+	* [r14928] src/mbma_mod.cxx: clearer code
+
+2012-06-26 10:54  sloot
+
+	* [r14927] src/mbma_mod.cxx: reduced debugging lines
+
+2012-06-26 09:30  sloot
+
+	* [r14925] include/frog/mbma_mod.h, src/mbma_mod.cxx,
+	  src/mbma_prog.cxx: and more refactoring. Things get sorted out a
+	  bit now
+
+2012-06-25 16:26  sloot
+
+	* [r14924] include/frog/mbma_mod.h, src/mbma_mod.cxx: more
+	  refactoring
+
+2012-06-25 14:22  sloot
+
+	* [r14923] include/frog/mbma_mod.h, src/mbma_mod.cxx: refactoring.
+	  mainly in an attempt to understand what is happening
+
+2012-06-21 15:53  sloot
+
+	* [r14906] include/frog/mbma_mod.h, src/mbma_mod.cxx: more
+	  refactoring
+	  still convoluted
+
+2012-06-21 15:22  sloot
+
+	* [r14905] src/mbma_mod.cxx: odd
+
+2012-06-21 15:04  sloot
+
+	* [r14904] include/frog/mbma_mod.h, src/Frog.cxx,
+	  src/mblem_mod.cxx, src/mbma_mod.cxx, src/mbma_prog.cxx: more
+	  refactoring
+
+2012-06-21 14:26  sloot
+
+	* [r14903] include/frog/mblem_mod.h, src/mblem_mod.cxx,
+	  src/mblem_prog.cxx: oppoetsen
+
+2012-06-21 13:12  sloot
+
+	* [r14901] include/frog/mblem_mod.h, src/Makefile.am,
+	  src/mblem_mod.cxx, src/mblem_prog.cxx, src/mbma_mod.cxx: added a
+	  mblem main program. Some refactoring done in mblem.
+	  More to do.
+
+2012-06-21 09:52  sloot
+
+	* [r14900] src/mbma_mod.cxx: fix uninstatiated var
+
+2012-06-18 14:46  sloot
+
+	* [r14883] src/mbma_mod.cxx: removed some code that seems to be
+	  unneeded
+
+2012-06-18 14:28  sloot
+
+	* [r14882] include/frog/mbma_mod.h, src/mbma_mod.cxx,
+	  src/mbma_prog.cxx: attempt to clean up further. not so much suc6
+	  as hoped for.
+
+2012-06-18 12:04  sloot
+
+	* [r14881] include/frog/mbma_mod.h, src/mbma_mod.cxx: avoid code
+	  duplication
+
+2012-06-18 09:27  sloot
+
+	* [r14880] src/mbma_prog.cxx: don't spoil outputfile
+
+2012-06-18 08:38  sloot
+
+	* [r14878] src/mbma_mod.cxx: accept fix as correct
+
+2012-06-14 14:41  sloot
+
+	* [r14872] src/Frog.cxx: added --KANON option to geberate canonical
+	  XML output
+
+2012-05-30 15:05  sloot
+
+	* [r14822] configure.ac, src/Makefile.am: another one bites the
+	  dust
+
+2012-05-30 14:51  sloot
+
+	* [r14821] configure.ac, src/Makefile.am: removed the infamous
+	  AC_DEFINE_DIR macro
+
+2012-05-30 13:35  sloot
+
+	* [r14818] include/frog/cgn_tagger_mod.h,
+	  include/frog/ucto_tokenizer_mod.h, src/cgn_tagger_mod.cxx,
+	  src/mbma_prog.cxx, src/ucto_tokenizer_mod.cxx: mbma_prog now used
+	  Ucto and Mbt to analyze the input.
+
+2012-05-23 15:54  sloot
+
+	* [r14794] src/mbma_prog.cxx: -d works now
+
+2012-05-23 15:41  sloot
+
+	* [r14793] src/Makefile.am, src/mbma_prog.cxx: added a simple mbma
+	  main program.
+	  it just gives al Morphological variants. No POS tags involved!
+
+2012-05-23 12:13  sloot
+
+	* [r14792] include/frog/mbma_mod.h, src/mbma_mod.cxx: added a
+	  transliterator which filters all diacritics.
+	  Default is is OFF
+	  use the 'filter_diacritics="yes"' option in de [mbma] section of
+	  frog.cfg to enable this.
+
+2012-05-22 14:42  sloot
+
+	* [r14782] include/frog/ucto_tokenizer_mod.h, src/Frog.cxx,
+	  src/ucto_tokenizer_mod.cxx: implemented the -Q option (which was
+	  advertized)
+
+2012-05-22 09:30  sloot
+
+	* [r14764] src/mbma_mod.cxx: cleaner debug info
+
+2012-05-21 15:42  sloot
+
+	* [r14760] bootstrap, include/frog/mbma_mod.h, src/Makefile.am,
+	  src/mbma_mod.cxx: some rework on mbma_mod. should make fixing a
+	  bit more simple in the future
+
+2012-05-15 14:21  sloot
+
+	* [r14747] src/mbma_mod.cxx: small (tentative) fix
+
+2012-05-15 08:01  sloot
+
+	* [r14746] configure.ac, src/Frog.cxx: Frog now also builds (and
+	  works) without OpenMp support (like in clang)
+
+2012-05-14 10:59  sloot
+
+	* [r14743] include/frog/mbma_mod.h, src/Makefile.am,
+	  src/mbma_mod.cxx: made a start with creating a libfrog. We will
+	  need it to be able to make some useful
+	  functions available to the outer world. (mblem and mbma
+	  functionality, for instance)
+	  Not finished.
+
+2012-05-08 14:24  sloot
+
+	* [r14726] include/frog/mbma_mod.h, src/mbma_mod.cxx: restrict
+	  special handling of 'be' and 'ge' to participles only
+
+2012-05-08 14:23  sloot
+
+	* [r14725] src/mblem_mod.cxx: added heuristic: Don't edit words
+	  when the result is only one character long
+
+2012-04-23 08:08  sloot
+
+	* [r14678] src/mblem_mod.cxx: Rvereted change because Maarten
+	  reverted his thoughts
+
+2012-04-21 19:42  antalb
+
+	* [r14676] AUTHORS: credit where credit is due
+
+2012-04-20 12:13  sloot
+
+	* [r14672] src/mblem_mod.cxx: Alternatives need an id
+
+2012-04-12 15:20  sloot
+
+	* [r14631] src/mblem_mod.cxx: refactoring and cleanup
+
+2012-04-12 14:28  sloot
+
+	* [r14630] src/mblem_mod.cxx: added comment
+
+2012-03-29 09:26  sloot
+
+	* [r14590] configure.ac: bump version after release
+
 2012-03-29 09:13  sloot
 
 	* [r14588] NEWS: updated NEWS for release
diff --git a/INSTALL b/INSTALL
index 7d1c323..a1e89e1 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
+Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
+   HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved.  Use GNU `make'
+instead.
+
    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
 parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
 a workaround.  If GNU CC is not installed, it is therefore recommended
diff --git a/Makefile.in b/Makefile.in
index 93d6d9e..92331b4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -43,10 +43,9 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	TODO config.guess config.sub depcomp install-sh ltmain.sh \
 	missing py-compile
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -80,9 +79,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -111,6 +112,8 @@ am__relativize = \
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -202,7 +205,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -212,12 +215,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -264,6 +267,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -280,7 +285,7 @@ all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
@@ -316,10 +321,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-	else :; fi
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -548,7 +551,11 @@ dist-gzip: distdir
 	$(am__remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
 	$(am__remove_distdir)
 
 dist-lzma: distdir
@@ -556,7 +563,7 @@ dist-lzma: distdir
 	$(am__remove_distdir)
 
 dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
 	$(am__remove_distdir)
 
 dist-tarZ: distdir
@@ -587,6 +594,8 @@ distcheck: dist
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
 	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -606,6 +615,7 @@ distcheck: dist
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -634,8 +644,16 @@ distcheck: dist
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@$(am__cd) '$(distuninstallcheck_dir)' \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -666,10 +684,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -757,8 +780,8 @@ uninstall-am:
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am am--refresh check check-am clean clean-generic \
 	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-	distcheck distclean distclean-generic distclean-hdr \
+	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-generic distclean-hdr \
 	distclean-libtool distclean-tags distcleancheck distdir \
 	distuninstallcheck dvi dvi-am html html-am info info-am \
 	install install-am install-data install-data-am install-dvi \
diff --git a/NEWS b/NEWS
index cc466e1..ec684a4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+0.12.17 - 2013-04-03
+ * the servermode now kan handle multiline input (non XML only).
+   Can be switched of with the -n option. 
+ * A lot of refactoring regarding FoLiA stuff
+ * start using ticcutils
+ * the -Q option now works
+ * added a --uttmarker option
+ * added mbma and mblem programs
+ * updated man pages
+
+0.12.16 - 2013-02-19
+ * bug fix release. Some stuff was moved from Timbl to libticcutils
+
 0.12.15 - 2012-03-29
  * using the new Mbt 3.2.8 API for Tagging.
    The code is much simpler and less error-prone now.
diff --git a/README b/README
index b8da899..6c3455f 100755
--- a/README
+++ b/README
@@ -1,62 +1,51 @@
-frog 0.12
+frog - A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
 
-  A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
-
-  http://ilk.uvt.nl/frog
+http://ilk.uvt.nl/frog
  
-  Copyright 2006, 2012 Bertjan Busser, Antal van den Bosch, and Ko
-  van der Sloot
-  ILK Research Group, Faculty of Humanities, Tilburg University
-  http://ilk.uvt.nl
+Copyright 2006, 2012 Bertjan Busser, Antal van den Bosch, and Ko van der Sloot
+
+ILK Research Group, Faculty of Humanities, Tilburg University http://ilk.uvt.nl
 
-  frog 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.
+frog 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.
 
-  frog 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.
+frog 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 <http://www.gnu.org/licenses/>.
+You should have received a copy of the GNU General Public License along with
+this program.  If not, see <http://www.gnu.org/licenses/>.
 
-  For questions and suggestions, see:
+For questions and suggestions, see:
       http://ilk.uvt.nl/software.html
-  or send mail to:
+or send mail to:
       timbl at uvt.nl
 
----------------------------------------------------------------------
+-------------------------------------------------------------------------------
 Preliminary note
 
-Frog can be considered alpha software, and is in a fair state of flux.
-Some intended functionalities are not there yet, such as a dependency
-parser. These will be added very soon. Other functionalities are there, but
-have not been fully tested yet, such as the multi-word chunker. More
-generally, error handling and reporting is still under development.
+Frog can be considered beta software, and, as of 2012-06, is being stabilized.
+All planned functionality (including a dependency parser, the multi-word
+chunker, Named Entity Recognition, Chunking and error handling and reporting)
+has been implemented and tested.
 
----------------------------------------------------------------------
+-------------------------------------------------------------------------------
 Installation and Quick Start
 
-TDo DO
-
+TODO
 
----------------------------------------------------------------------
+-------------------------------------------------------------------------------
 Credits
 
-Many thanks go out to the people who made the developments of the
-Frog components possible: Walter Daelemans, Jakub Zavrel, Ko van
-der Sloot, Sabine Buchholz, Sander Canisius, Gert Durieux, and Peter
-Berck. 
+Many thanks go out to the people who made the developments of the Frog
+components possible: Walter Daelemans, Jakub Zavrel, Ko van der Sloot, Sabine
+Buchholz, Sander Canisius, Gert Durieux, and Peter Berck. 
 
-Thanks to Erik Tjong Kim Sang and Lieve Macken for stress-testing the
-first versions of Tadpole, de predecessor of Frog
+Thanks to Erik Tjong Kim Sang and Lieve Macken for stress-testing the first
+versions of Tadpole, the predecessor of Frog
 
-
----------------------------------------------------------------------
+-------------------------------------------------------------------------------
 References
 
 TODO
-
-
diff --git a/aclocal.m4 b/aclocal.m4
index aa576f9..cf5b2bd 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,8 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -19,12 +20,15 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
@@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.11.3], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.11.3])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
@@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
+# serial 12
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK],
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
@@ -545,12 +555,15 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -682,12 +695,15 @@ else
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_PROG_MKDIR_P
 # ---------------
 # Check for `mkdir -p'.
@@ -710,13 +726,14 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -724,13 +741,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -741,13 +758,15 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
+# 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 # ---------------------------------------------------------------------------
 # Adds support for distributing Python modules and packages.  To
@@ -775,8 +794,10 @@ AC_DEFUN([AM_PATH_PYTHON],
   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
   dnl supported. (2.0 was released on October 16, 2000).
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-                    [python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 dnl
-python2.1 python2.0])
+[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
+ python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
+
+  AC_ARG_VAR([PYTHON], [the Python interpreter])
 
   m4_if([$1],[],[
     dnl No version check is needed.
@@ -848,9 +869,7 @@ python2.1 python2.0])
   dnl   site-packages directory, not the python standard library
   dnl   directory like in previous automake betas.  This behavior
   dnl   is more consistent with lispdir.m4 for example.
-  dnl Query distutils for this directory.  distutils does not exist in
-  dnl Python 1.5, so we fall back to the hardcoded directory if it
-  dnl doesn't work.
+  dnl Query distutils for this directory.
   AC_CACHE_CHECK([for $am_display_PYTHON script directory],
     [am_cv_python_pythondir],
     [if test "x$prefix" = xNONE
@@ -859,8 +878,7 @@ python2.1 python2.0])
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -886,9 +904,7 @@ python2.1 python2.0])
 
   dnl pyexecdir -- directory for installing python extension modules
   dnl   (shared libraries)
-  dnl Query distutils for this directory.  distutils does not exist in
-  dnl Python 1.5, so we fall back to the hardcoded directory if it
-  dnl doesn't work.
+  dnl Query distutils for this directory.
   AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
     [am_cv_python_pyexecdir],
     [if test "x$exec_prefix" = xNONE
@@ -897,8 +913,7 @@ python2.1 python2.0])
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -946,12 +961,14 @@ for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
 sys.exit(sys.hexversion < minverhex)"
   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_RUN_LOG(COMMAND)
 # -------------------
 # Run COMMAND, save the exit status in ac_status, and log it.
@@ -1028,12 +1045,14 @@ Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_PROG_INSTALL_STRIP
 # ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
@@ -1056,13 +1075,13 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -1071,13 +1090,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1099,10 +1118,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
@@ -1171,10 +1191,9 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
-m4_include([m4/ac_define_dir.m4])
 m4_include([m4/ac_python_devel.m4])
-m4_include([m4/acx_pthread.m4])
 m4_include([m4/ax_icu_check.m4])
+m4_include([m4/ax_pthread.m4])
 m4_include([m4/libtool.m4])
 m4_include([m4/ltoptions.m4])
 m4_include([m4/ltsugar.m4])
diff --git a/bootstrap b/bootstrap
index 81b6ee7..2570f0f 100644
--- a/bootstrap
+++ b/bootstrap
@@ -1,5 +1,5 @@
-# $Id: bootstrap 8582 2011-02-27 11:38:10Z joostvb $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/bootstrap $
+# $Id: bootstrap 15362 2012-10-30 12:37:03Z mvgompel $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/bootstrap $
 
 # bootstrap - script to bootstrap the distribution rolling engine
 
@@ -50,6 +50,12 @@ aclocal=aclocal
       then
          found=true
          break
+      else
+	if test -f ${d}ax_define_dir.m4
+      	then
+	  found=true
+          break
+        fi
       fi
    done
 
@@ -64,7 +70,7 @@ EOT
    fi
 
 
-if $automake --version|head -1 |grep '1\.[4-8]'; then
+if $automake --version|head -1 |grep ' 1\.[4-8]'; then
     echo "automake 1.4-1.8 is active. You should use automake 1.9 or later"
     if test -f /etc/debian_version; then
         echo " sudo apt-get install automake1.9"
@@ -73,7 +79,7 @@ if $automake --version|head -1 |grep '1\.[4-8]'; then
     exit 1
 fi
 
-if $aclocal --version|head -1 |grep '1\.[4-8]'; then
+if $aclocal --version|head -1 |grep ' 1\.[4-8]'; then
     echo "aclocal 1.4-1.8 is active. You should use aclocal 1.9 or later"
     if test -f /etc/debian_version; then	
         echo " sudo apt-get install aclocal1.9"
diff --git a/config.guess b/config.guess
index 40eaed4..d622a44 100755
--- a/config.guess
+++ b/config.guess
@@ -2,9 +2,9 @@
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2011-05-11'
+timestamp='2012-02-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ timestamp='2011-05-11'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -57,8 +55,8 @@ GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -792,13 +790,12 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
 	    amd64)
 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	esac
 	exit ;;
     i*:CYGWIN*:*)
@@ -807,6 +804,9 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
     i*:windows32*:*)
 	# uname -m includes "-pc" on this system.
 	echo ${UNAME_MACHINE}-mingw32
@@ -861,6 +861,13 @@ EOF
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -895,13 +902,16 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	LIBC=gnu
@@ -943,7 +953,7 @@ EOF
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     padre:Linux:*:*)
 	echo sparc-unknown-linux-gnu
@@ -978,13 +988,13 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-tilera-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     vax:Linux:*:*)
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -1315,6 +1325,9 @@ EOF
     i*86:AROS:*:*)
 	echo ${UNAME_MACHINE}-pc-aros
 	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/config.h.in b/config.h.in
index 63ca191..2ac55f8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -22,9 +22,15 @@
 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
 #undef HAVE_NDIR_H
 
+/* Define to 1 if you have OpenMP */
+#undef HAVE_OPENMP
+
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
 /* If available, contains the Python version number currently in use. */
 #undef HAVE_PYTHON
 
@@ -107,15 +113,9 @@
    your system. */
 #undef PTHREAD_CREATE_JOINABLE
 
-/* PYTHONDIR */
-#undef PYTHONDIR
-
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* sysconfdir */
-#undef SYSCONF_PATH
-
 /* Version number of package */
 #undef VERSION
 
diff --git a/config.sub b/config.sub
index 30fdca8..c894da4 100755
--- a/config.sub
+++ b/config.sub
@@ -2,9 +2,9 @@
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2011-03-23'
+timestamp='2012-02-10'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@ timestamp='2011-03-23'
 # 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, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -76,8 +74,8 @@ version="\
 GNU config.sub ($timestamp)
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -132,6 +130,10 @@ case $maybe_os in
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -247,17 +249,22 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 	| maxq | mb | microblaze | mcore | mep | metag \
@@ -291,7 +298,7 @@ case $basic_machine in
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| rx \
+	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
@@ -300,7 +307,7 @@ case $basic_machine in
 	| spu \
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
-	| v850 | v850e \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -315,8 +322,7 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -329,7 +335,10 @@ case $basic_machine in
 	strongarm | thumb | xscale)
 		basic_machine=arm-unknown
 		;;
-
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
 	xscaleeb)
 		basic_machine=armeb-unknown
 		;;
@@ -352,11 +361,13 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
@@ -365,8 +376,10 @@ case $basic_machine in
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -400,7 +413,7 @@ case $basic_machine in
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* | rx-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
@@ -408,10 +421,11 @@ case $basic_machine in
 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
 	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile-* | tilegx-* \
+	| tile*-* \
 	| tron-* \
 	| ubicom32-* \
-	| v850-* | v850e-* | vax-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -711,7 +725,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -808,10 +821,18 @@ case $basic_machine in
 	ms1-*)
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -1120,13 +1141,8 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	# This must be matched before tile*.
-	tilegx*)
-		basic_machine=tilegx-unknown
-		os=-linux-gnu
-		;;
 	tile*)
-		basic_machine=tile-unknown
+		basic_machine=$basic_machine-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1336,7 +1352,7 @@ case $os in
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1548,9 +1564,6 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
diff --git a/configure b/configure
index 6383582..1a5f96e 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for frog 0.12.15.
+# Generated by GNU Autoconf 2.68 for frog 0.12.17.
 #
 # Report bugs to <timbl at uvt.nl>.
 #
@@ -569,8 +569,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='frog'
 PACKAGE_TARNAME='frog'
-PACKAGE_VERSION='0.12.15'
-PACKAGE_STRING='frog 0.12.15'
+PACKAGE_VERSION='0.12.17'
+PACKAGE_STRING='frog 0.12.17'
 PACKAGE_BUGREPORT='timbl at uvt.nl'
 PACKAGE_URL=''
 
@@ -638,6 +638,8 @@ mbt_LIBS
 mbt_CFLAGS
 timblserver_LIBS
 timblserver_CFLAGS
+ticcutils_LIBS
+ticcutils_CFLAGS
 timbl_LIBS
 timbl_CFLAGS
 ICU_IOLIBS
@@ -655,7 +657,8 @@ PKG_CONFIG
 PTHREAD_CFLAGS
 PTHREAD_LIBS
 PTHREAD_CC
-acx_pthread_config
+ax_pthread_config
+SYSCONFDIR
 LIBTOOL_DEPS
 CXXCPP
 CPP
@@ -697,6 +700,7 @@ RANLIB
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -710,7 +714,6 @@ CPPFLAGS
 LDFLAGS
 CXXFLAGS
 CXX
-SYSCONF_PATH
 am__untar
 am__tar
 AMTAR
@@ -785,6 +788,7 @@ with_sysroot
 enable_libtool_lock
 with_icu
 with_timbl
+with_ticcutils
 with_timblserver
 with_mbt
 with_folia
@@ -809,6 +813,8 @@ PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
 timbl_CFLAGS
 timbl_LIBS
+ticcutils_CFLAGS
+ticcutils_LIBS
 timblserver_CFLAGS
 timblserver_LIBS
 mbt_CFLAGS
@@ -817,6 +823,7 @@ folia_CFLAGS
 folia_LIBS
 ucto_CFLAGS
 ucto_LIBS
+PYTHON
 PYTHON_VERSION'
 
 
@@ -1360,7 +1367,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures frog 0.12.15 to adapt to many kinds of systems.
+\`configure' configures frog 0.12.17 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1430,7 +1437,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of frog 0.12.15:";;
+     short | recursive ) echo "Configuration of frog 0.12.17:";;
    esac
   cat <<\_ACEOF
 
@@ -1456,6 +1463,7 @@ Optional Packages:
                         (or the compiler's sysroot if not specified).
   --with-icu=DIR       use ICU installed in <DIR>
   --with-timbl=DIR       use timbl installed in <DIR>
+  --with-ticcutils=DIR       use ticcutils installed in <DIR>
   --with-timblserver=DIR     use timblserver installed in <DIR>
   --with-mbt=DIR       use mbt installed in <DIR>
   --with-folia=DIR       use libfolia installed in <DIR>
@@ -1482,6 +1490,10 @@ Some influential environment variables:
   timbl_CFLAGS
               C compiler flags for timbl, overriding pkg-config
   timbl_LIBS  linker flags for timbl, overriding pkg-config
+  ticcutils_CFLAGS
+              C compiler flags for ticcutils, overriding pkg-config
+  ticcutils_LIBS
+              linker flags for ticcutils, overriding pkg-config
   timblserver_CFLAGS
               C compiler flags for timblserver, overriding pkg-config
   timblserver_LIBS
@@ -1493,6 +1505,7 @@ Some influential environment variables:
   folia_LIBS  linker flags for folia, overriding pkg-config
   ucto_CFLAGS C compiler flags for ucto, overriding pkg-config
   ucto_LIBS   linker flags for ucto, overriding pkg-config
+  PYTHON      the Python interpreter
   PYTHON_VERSION
               The installed Python version to use, for example '2.3'. This
               string will be appended to the Python interpreter canonical
@@ -1564,7 +1577,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-frog configure 0.12.15
+frog configure 0.12.17
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2217,7 +2230,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by frog $as_me 0.12.15, which was
+It was created by frog $as_me 0.12.17, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -3032,7 +3045,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='frog'
- VERSION='0.12.15'
+ VERSION='0.12.17'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3062,11 +3075,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -3077,25 +3090,6 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 ac_config_headers="$ac_config_headers config.h"
 
 
-# AC_DEFINE_DIR is defined in acinclude.m4
-
-  prefix_NONE=
-  exec_prefix_NONE=
-  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
-  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
-  eval ac_define_dir="\"$sysconfdir\""
-  eval ac_define_dir="\"$ac_define_dir\""
-  SYSCONF_PATH="$ac_define_dir"
-
-
-cat >>confdefs.h <<_ACEOF
-#define SYSCONF_PATH "$ac_define_dir"
-_ACEOF
-
-  test "$prefix_NONE" && prefix=NONE
-  test "$exec_prefix_NONE" && exec_prefix=NONE
-
-
 if test x"${CXXFLAGS+set}" = xset; then
   # the user set CXXFLAGS; don't override it.
   cxx_flags_were_set=true
@@ -3662,6 +3656,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -3686,6 +3681,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3745,7 +3741,7 @@ else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -3906,8 +3902,8 @@ esac
 
 
 
-macro_version='2.4'
-macro_revision='1.3293'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -4616,6 +4612,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4675,7 +4672,7 @@ else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -15329,6 +15326,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+SYSCONFDIR=$sysconfdir
+
+
 # when running tests, use CXX
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -15831,14 +15831,13 @@ fi
 
 
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-acx_pthread_ok=no
+ax_pthread_ok=no
 
 # We used to check for pthread.h first, but this fails if pthread.h
 # requires special compiler flags (e.g. on True64 or Sequent).
@@ -15873,13 +15872,13 @@ return pthread_join ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  acx_pthread_ok=yes
+  ax_pthread_ok=yes
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
-$as_echo "$acx_pthread_ok" >&6; }
-        if test x"$acx_pthread_ok" = xno; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test x"$ax_pthread_ok" = xno; then
                 PTHREAD_LIBS=""
                 PTHREAD_CFLAGS=""
         fi
@@ -15897,7 +15896,7 @@ fi
 # which indicates that we try without any flags at all, and "pthread-config"
 # which is a program returning the flags for the Pth emulation library.
 
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
 
 # The ordering *is* (sometimes) important.  Some notes on the
 # individual items follow:
@@ -15930,12 +15929,16 @@ case "${host_cpu}-${host_os}" in
         # who knows whether they'll stub that too in a future libc.)  So,
         # we'll just look for -pthreads and -lpthread first:
 
-        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+        *-darwin*)
+        ax_pthread_flags="-pthread $ax_pthread_flags"
         ;;
 esac
 
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
 
         case $flag in
                 none)
@@ -15949,16 +15952,16 @@ $as_echo_n "checking whether pthreads work with $flag... " >&6; }
                 PTHREAD_CFLAGS="$flag"
                 ;;
 
-		pthread-config)
-		# Extract the first word of "pthread-config", so it can be a program name with args.
+                pthread-config)
+                # Extract the first word of "pthread-config", so it can be a program name with args.
 set dummy pthread-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_acx_pthread_config+:} false; then :
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$acx_pthread_config"; then
-  ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
+  if test -n "$ax_pthread_config"; then
+  ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -15967,7 +15970,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_acx_pthread_config="yes"
+    ac_cv_prog_ax_pthread_config="yes"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -15975,23 +15978,23 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
+  test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
 fi
 fi
-acx_pthread_config=$ac_cv_prog_acx_pthread_config
-if test -n "$acx_pthread_config"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5
-$as_echo "$acx_pthread_config" >&6; }
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-		if test x"$acx_pthread_config" = xno; then continue; fi
-		PTHREAD_CFLAGS="`pthread-config --cflags`"
-		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
-		;;
+                if test x"$ax_pthread_config" = xno; then continue; fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
 
                 *)
                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
@@ -16017,18 +16020,23 @@ $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }
 int
 main ()
 {
-pthread_t th; pthread_join(th, 0);
-                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
-                     pthread_create(0,0,0,0); pthread_cleanup_pop(0);
+pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  acx_pthread_ok=yes
+  ax_pthread_ok=yes
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -16036,9 +16044,9 @@ rm -f core conftest.err conftest.$ac_objext \
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
-$as_echo "$acx_pthread_ok" >&6; }
-        if test "x$acx_pthread_ok" = xyes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = xyes; then
                 break;
         fi
 
@@ -16048,24 +16056,24 @@ done
 fi
 
 # Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
+if test "x$ax_pthread_ok" = xyes; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         save_CFLAGS="$CFLAGS"
         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
 $as_echo_n "checking for joinable pthread attribute... " >&6; }
-	attr_name=unknown
-	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        attr_name=unknown
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
 int
 main ()
 {
-int attr=$attr; return attr;
+int attr = $attr; return attr /* ; */
   ;
   return 0;
 }
@@ -16075,7 +16083,7 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	done
+        done
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
 $as_echo "$attr_name" >&6; }
         if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
@@ -16099,11 +16107,46 @@ $as_echo "${flag}" >&6; }
             PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
         fi
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                    #include <pthread.h>
+int
+main ()
+{
+int i = PTHREAD_PRIO_INHERIT;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_cv_PTHREAD_PRIO_INHERIT=yes
+else
+  ax_cv_PTHREAD_PRIO_INHERIT=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+        if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then :
+
+$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
+
+fi
+
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
         # More AIX lossage: must compile with xlc_r or cc_r
-	if test x"$GCC" != xyes; then
+        if test x"$GCC" != xyes; then
           for ac_prog in xlc_r cc_r
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -16149,7 +16192,7 @@ test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
 
         else
           PTHREAD_CC=$CC
-	fi
+        fi
 else
         PTHREAD_CC="$CC"
 fi
@@ -16159,13 +16202,13 @@ fi
 
 
 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
+if test x"$ax_pthread_ok" = xyes; then
 
 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
 
         :
 else
-        acx_pthread_ok=no
+        ax_pthread_ok=no
         as_fn_error $? "We need pthread support!" "$LINENO" 5
 fi
 ac_ext=cpp
@@ -16232,14 +16275,17 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5
 $as_echo "$ax_cv_cxx_openmp" >&6; }
 if test "x$ax_cv_cxx_openmp" = "xunknown"; then
-  as_fn_error $? "We need OpenMP, please use a recent compiler!" "$LINENO" 5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: We don't have OpenMP. Multithreaded testing is disabled" >&5
+$as_echo "$as_me: We don't have OpenMP. Multithreaded testing is disabled" >&6;}
 else
   if test "x$ax_cv_cxx_openmp" != "xnone"; then
     OPENMP_CXXFLAGS=$ax_cv_cxx_openmp
   fi
   CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
-fi
 
+$as_echo "#define HAVE_OPENMP 1 " >>confdefs.h
+
+fi
 
 
 if test $prefix = "NONE"; then
@@ -16252,6 +16298,7 @@ fi
 
 
 
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -16581,12 +16628,13 @@ if test -n "$timbl_CFLAGS"; then
     pkg_cv_timbl_CFLAGS="$timbl_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timbl >= 6.4.2 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "timbl >= 6.4.2 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timbl >= 6.4.4 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "timbl >= 6.4.4 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_timbl_CFLAGS=`$PKG_CONFIG --cflags "timbl >= 6.4.2 " 2>/dev/null`
+  pkg_cv_timbl_CFLAGS=`$PKG_CONFIG --cflags "timbl >= 6.4.4 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16597,12 +16645,13 @@ if test -n "$timbl_LIBS"; then
     pkg_cv_timbl_LIBS="$timbl_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timbl >= 6.4.2 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "timbl >= 6.4.2 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timbl >= 6.4.4 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "timbl >= 6.4.4 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_timbl_LIBS=`$PKG_CONFIG --libs "timbl >= 6.4.2 " 2>/dev/null`
+  pkg_cv_timbl_LIBS=`$PKG_CONFIG --libs "timbl >= 6.4.4 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16622,14 +16671,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        timbl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "timbl >= 6.4.2 " 2>&1`
+	        timbl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "timbl >= 6.4.4 " 2>&1`
         else
-	        timbl_PKG_ERRORS=`$PKG_CONFIG --print-errors "timbl >= 6.4.2 " 2>&1`
+	        timbl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "timbl >= 6.4.4 " 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$timbl_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (timbl >= 6.4.2 ) were not met:
+	as_fn_error $? "Package requirements (timbl >= 6.4.4 ) were not met:
 
 $timbl_PKG_ERRORS
 
@@ -16665,6 +16714,108 @@ CXXFLAGS="$CXXFLAGS $timbl_CFLAGS"
 LIBS="$timbl_LIBS $LIBS"
 
 
+# Check whether --with-ticcutils was given.
+if test "${with_ticcutils+set}" = set; then :
+  withval=$with_ticcutils; PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"
+else
+  PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"
+fi
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ticcutils" >&5
+$as_echo_n "checking for ticcutils... " >&6; }
+
+if test -n "$ticcutils_CFLAGS"; then
+    pkg_cv_ticcutils_CFLAGS="$ticcutils_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ticcutils >= 0.4 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ticcutils >= 0.4 ") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ticcutils_CFLAGS=`$PKG_CONFIG --cflags "ticcutils >= 0.4 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$ticcutils_LIBS"; then
+    pkg_cv_ticcutils_LIBS="$ticcutils_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ticcutils >= 0.4 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ticcutils >= 0.4 ") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ticcutils_LIBS=`$PKG_CONFIG --libs "ticcutils >= 0.4 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        ticcutils_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ticcutils >= 0.4 " 2>&1`
+        else
+	        ticcutils_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ticcutils >= 0.4 " 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$ticcutils_PKG_ERRORS" >&5
+
+	as_fn_error $? "Package requirements (ticcutils >= 0.4 ) were not met:
+
+$ticcutils_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ticcutils_CFLAGS
+and ticcutils_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ticcutils_CFLAGS
+and ticcutils_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	ticcutils_CFLAGS=$pkg_cv_ticcutils_CFLAGS
+	ticcutils_LIBS=$pkg_cv_ticcutils_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
+LIBS="$ticcutils_LIBS $LIBS"
+
+
 # Check whether --with-timblserver was given.
 if test "${with_timblserver+set}" = set; then :
   withval=$with_timblserver; PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"
@@ -16681,12 +16832,13 @@ if test -n "$timblserver_CFLAGS"; then
     pkg_cv_timblserver_CFLAGS="$timblserver_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timblserver >= 1.4 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "timblserver >= 1.4 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timblserver >= 1.7 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "timblserver >= 1.7 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_timblserver_CFLAGS=`$PKG_CONFIG --cflags "timblserver >= 1.4 " 2>/dev/null`
+  pkg_cv_timblserver_CFLAGS=`$PKG_CONFIG --cflags "timblserver >= 1.7 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16697,12 +16849,13 @@ if test -n "$timblserver_LIBS"; then
     pkg_cv_timblserver_LIBS="$timblserver_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timblserver >= 1.4 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "timblserver >= 1.4 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"timblserver >= 1.7 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "timblserver >= 1.7 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_timblserver_LIBS=`$PKG_CONFIG --libs "timblserver >= 1.4 " 2>/dev/null`
+  pkg_cv_timblserver_LIBS=`$PKG_CONFIG --libs "timblserver >= 1.7 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16722,14 +16875,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        timblserver_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "timblserver >= 1.4 " 2>&1`
+	        timblserver_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "timblserver >= 1.7 " 2>&1`
         else
-	        timblserver_PKG_ERRORS=`$PKG_CONFIG --print-errors "timblserver >= 1.4 " 2>&1`
+	        timblserver_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "timblserver >= 1.7 " 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$timblserver_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (timblserver >= 1.4 ) were not met:
+	as_fn_error $? "Package requirements (timblserver >= 1.7 ) were not met:
 
 $timblserver_PKG_ERRORS
 
@@ -16781,12 +16934,13 @@ if test -n "$mbt_CFLAGS"; then
     pkg_cv_mbt_CFLAGS="$mbt_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mbt >= 3.2.8 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "mbt >= 3.2.8 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mbt >= 3.2.10 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "mbt >= 3.2.10 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_mbt_CFLAGS=`$PKG_CONFIG --cflags "mbt >= 3.2.8 " 2>/dev/null`
+  pkg_cv_mbt_CFLAGS=`$PKG_CONFIG --cflags "mbt >= 3.2.10 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16797,12 +16951,13 @@ if test -n "$mbt_LIBS"; then
     pkg_cv_mbt_LIBS="$mbt_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mbt >= 3.2.8 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "mbt >= 3.2.8 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mbt >= 3.2.10 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "mbt >= 3.2.10 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_mbt_LIBS=`$PKG_CONFIG --libs "mbt >= 3.2.8 " 2>/dev/null`
+  pkg_cv_mbt_LIBS=`$PKG_CONFIG --libs "mbt >= 3.2.10 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16822,14 +16977,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        mbt_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "mbt >= 3.2.8 " 2>&1`
+	        mbt_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mbt >= 3.2.10 " 2>&1`
         else
-	        mbt_PKG_ERRORS=`$PKG_CONFIG --print-errors "mbt >= 3.2.8 " 2>&1`
+	        mbt_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mbt >= 3.2.10 " 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$mbt_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (mbt >= 3.2.8 ) were not met:
+	as_fn_error $? "Package requirements (mbt >= 3.2.10 ) were not met:
 
 $mbt_PKG_ERRORS
 
@@ -16883,12 +17038,13 @@ if test -n "$folia_CFLAGS"; then
     pkg_cv_folia_CFLAGS="$folia_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.9\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "folia >= 0.9") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.10\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "folia >= 0.10") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_folia_CFLAGS=`$PKG_CONFIG --cflags "folia >= 0.9" 2>/dev/null`
+  pkg_cv_folia_CFLAGS=`$PKG_CONFIG --cflags "folia >= 0.10" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16899,12 +17055,13 @@ if test -n "$folia_LIBS"; then
     pkg_cv_folia_LIBS="$folia_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.9\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "folia >= 0.9") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.10\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "folia >= 0.10") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_folia_LIBS=`$PKG_CONFIG --libs "folia >= 0.9" 2>/dev/null`
+  pkg_cv_folia_LIBS=`$PKG_CONFIG --libs "folia >= 0.10" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16924,14 +17081,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        folia_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "folia >= 0.9" 2>&1`
+	        folia_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "folia >= 0.10" 2>&1`
         else
-	        folia_PKG_ERRORS=`$PKG_CONFIG --print-errors "folia >= 0.9" 2>&1`
+	        folia_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "folia >= 0.10" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$folia_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (folia >= 0.9) were not met:
+	as_fn_error $? "Package requirements (folia >= 0.10) were not met:
 
 $folia_PKG_ERRORS
 
@@ -16983,12 +17140,13 @@ if test -n "$ucto_CFLAGS"; then
     pkg_cv_ucto_CFLAGS="$ucto_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ucto >= 0.5.1 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "ucto >= 0.5.1 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ucto >= 0.5.3 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ucto >= 0.5.3 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_ucto_CFLAGS=`$PKG_CONFIG --cflags "ucto >= 0.5.1 " 2>/dev/null`
+  pkg_cv_ucto_CFLAGS=`$PKG_CONFIG --cflags "ucto >= 0.5.3 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -16999,12 +17157,13 @@ if test -n "$ucto_LIBS"; then
     pkg_cv_ucto_LIBS="$ucto_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ucto >= 0.5.1 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "ucto >= 0.5.1 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ucto >= 0.5.3 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ucto >= 0.5.3 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_ucto_LIBS=`$PKG_CONFIG --libs "ucto >= 0.5.1 " 2>/dev/null`
+  pkg_cv_ucto_LIBS=`$PKG_CONFIG --libs "ucto >= 0.5.3 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -17024,14 +17183,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        ucto_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ucto >= 0.5.1 " 2>&1`
+	        ucto_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ucto >= 0.5.3 " 2>&1`
         else
-	        ucto_PKG_ERRORS=`$PKG_CONFIG --print-errors "ucto >= 0.5.1 " 2>&1`
+	        ucto_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ucto >= 0.5.3 " 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$ucto_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (ucto >= 0.5.1 ) were not met:
+	as_fn_error $? "Package requirements (ucto >= 0.5.3 ) were not met:
 
 $ucto_PKG_ERRORS
 
@@ -17085,6 +17244,8 @@ fi
 
 
 
+
+
         if test -n "$PYTHON"; then
       # If the user set $PYTHON, use it and don't search something else.
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.5" >&5
@@ -17118,7 +17279,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+	for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
 	  test "$am_cv_pathless_PYTHON" = none && break
 	  prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -17227,7 +17388,7 @@ $as_echo "$am_cv_python_platform" >&6; }
 
 
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
 if ${am_cv_python_pythondir+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -17238,8 +17399,7 @@ else
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -17265,7 +17425,7 @@ $as_echo "$am_cv_python_pythondir" >&6; }
   pkgpythondir=\${pythondir}/$PACKAGE
 
 
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
 if ${am_cv_python_pyexecdir+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -17276,8 +17436,7 @@ else
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -17303,22 +17462,7 @@ $as_echo "$am_cv_python_pyexecdir" >&6; }
   pkgpyexecdir=\${pyexecdir}/$PACKAGE
 
 
-
-  prefix_NONE=
-  exec_prefix_NONE=
-  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
-  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
-  eval ac_define_dir="\"$pkgpythondir\""
-  eval ac_define_dir="\"$ac_define_dir\""
-  PYTHONDIR="$ac_define_dir"
-
-
-cat >>confdefs.h <<_ACEOF
-#define PYTHONDIR "$ac_define_dir"
-_ACEOF
-
-  test "$prefix_NONE" && prefix=NONE
-  test "$exec_prefix_NONE" && exec_prefix=NONE
+    PYTHONDIR=${pkgpythondir}
 
   fi
 
@@ -18241,7 +18385,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by frog $as_me 0.12.15, which was
+This file was extended by frog $as_me 0.12.17, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18307,7 +18451,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-frog config.status 0.12.15
+frog config.status 0.12.17
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index c73ea8f..6a084ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,18 +1,15 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
-# $Id: configure.ac 14580 2012-03-28 15:03:55Z sloot $
+# $Id: configure.ac 15906 2013-04-03 13:15:22Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/configure.ac $
 
 AC_PREREQ(2.59)
-AC_INIT([frog], [0.12.15], [timbl at uvt.nl])
+AC_INIT([frog], [0.12.17], [timbl at uvt.nl])
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADER([config.h])
 
-# AC_DEFINE_DIR is defined in acinclude.m4
-AC_DEFINE_DIR([SYSCONF_PATH], sysconfdir, sysconfdir)
-
 if test x"${CXXFLAGS+set}" = xset; then
   # the user set CXXFLAGS; don't override it.
   cxx_flags_were_set=true
@@ -32,6 +29,9 @@ AC_PROG_RANLIB
 AC_PROG_LIBTOOL
 AC_SUBST([LIBTOOL_DEPS])
 
+SYSCONFDIR=$sysconfdir
+AC_SUBST([SYSCONFDIR])
+
 # when running tests, use CXX
 AC_LANG([C++])
 
@@ -54,9 +54,9 @@ if test x"$acx_pthread_ok" = xyes; then
 fi
 
 # check for OpenMP
-OPENMP_CHECK( [CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"],
-	      [AC_MSG_ERROR([We need OpenMP, please use a recent compiler!])])
-
+OPENMP_CHECK( [CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
+	      AC_DEFINE(HAVE_OPENMP, 1 , Define to 1 if you have OpenMP )],
+	      [AC_MSG_NOTICE(We don't have OpenMP. Multithreaded testing is disabled)] )
 
 if test $prefix = "NONE"; then
    prefix="$ac_default_prefix"
@@ -98,15 +98,23 @@ AC_ARG_WITH(timbl,
        [  --with-timbl=DIR       use timbl installed in <DIR>],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"])
-PKG_CHECK_MODULES([timbl], [timbl >= 6.4.2] )
+PKG_CHECK_MODULES([timbl], [timbl >= 6.4.4] )
 CXXFLAGS="$CXXFLAGS $timbl_CFLAGS"
 LIBS="$timbl_LIBS $LIBS"
 
+AC_ARG_WITH(ticcutils,
+       [  --with-ticcutils=DIR       use ticcutils installed in <DIR>],
+       [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"],
+       [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"])
+PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.4] )
+CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
+LIBS="$ticcutils_LIBS $LIBS"
+
 AC_ARG_WITH(timblserver,
        [  --with-timblserver=DIR     use timblserver installed in <DIR>],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"])
-PKG_CHECK_MODULES([timblserver], [timblserver >= 1.4] )
+PKG_CHECK_MODULES([timblserver], [timblserver >= 1.7] )
 CXXFLAGS="$CXXFLAGS $timblserver_CFLAGS"
 LIBS="$timblserver_LIBS $LIBS"
 
@@ -114,7 +122,7 @@ AC_ARG_WITH(mbt,
        [  --with-mbt=DIR       use mbt installed in <DIR>],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"])
-PKG_CHECK_MODULES([mbt], [mbt >= 3.2.8] )
+PKG_CHECK_MODULES([mbt], [mbt >= 3.2.10] )
 CXXFLAGS="$CXXFLAGS $mbt_CFLAGS"
 LIBS="$mbt_LIBS $LIBS"
 
@@ -123,7 +131,7 @@ AC_ARG_WITH(folia,
        [PKG_CONFIG_PATH="$withval/lib/pkgconfig:$PKG_CONFIG_PATH"],
        [PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"])
 AC_MSG_NOTICE( [pkg-config search path: $PKG_CONFIG_PATH] )
-PKG_CHECK_MODULES([folia],[folia >= 0.9])
+PKG_CHECK_MODULES([folia],[folia >= 0.10])
 CXXFLAGS="$CXXFLAGS $folia_CFLAGS"
 LIBS="$folia_LIBS $LIBS"
 
@@ -131,7 +139,7 @@ AC_ARG_WITH(ucto,
        [  --with-ucto=DIR       use ucto installed in <DIR>],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"])
-PKG_CHECK_MODULES([ucto], [ucto >= 0.5.1] )
+PKG_CHECK_MODULES([ucto], [ucto >= 0.5.3] )
 CXXFLAGS="$CXXFLAGS $ucto_CFLAGS"
 LIBS="$ucto_LIBS $LIBS"
 
@@ -147,7 +155,8 @@ AC_ARG_WITH(python,
 
 #we need Python > 2.5.x
 AM_PATH_PYTHON([2.5],
-	[AC_DEFINE_DIR([PYTHONDIR],pkgpythondir, PYTHONDIR)],
+	[PYTHONDIR=${pkgpythondir}
+	 AC_SUBST([PYTHONDIR])],
 	[:])
 
 # set PYTHON_EXTRA_LIBS to a non-empty string
diff --git a/depcomp b/depcomp
index df8eea7..bd0ac08 100755
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-12-04.11; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
 
 # 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
@@ -44,7 +44,7 @@ Environment variables:
   object      Object file output by `PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -90,10 +90,18 @@ if test "$depmode" = msvcmsys; then
    # This is just like msvisualcpp but w/o cygpath translation.
    # Just convert the backslash-escaped backslashes to single forward
    # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
+   cygpath_u='sed s,\\\\,/,g'
    depmode=msvisualcpp
 fi
 
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
@@ -158,10 +166,12 @@ gcc)
 ' < "$tmpdepfile" |
 ## Some versions of gcc put a space before the `:'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -405,6 +415,52 @@ tru64)
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/	\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/	/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -503,7 +559,9 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
   sed '1,2d' "$tmpdepfile" | tr ' ' '
 ' | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 31df0b5..9c44086 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,5 +1,5 @@
-# $Id: Makefile.am 14239 2012-02-09 15:54:20Z sloot $
+# $Id: Makefile.am 15946 2013-04-04 12:22:16Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/docs/Makefile.am $
 
-man1_MANS = frog.1 frog-dp-update.1
-EXTRA_DIST = frog.1 frog-dp-update.1
+man1_MANS = frog.1 mbma.1 mblem.1
+EXTRA_DIST = frog.1 mbma.1 mblem.1
diff --git a/docs/Makefile.in b/docs/Makefile.in
index c93f383..e093494 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,7 @@
 
 @SET_MAKE@
 
-# $Id: Makefile.am 14239 2012-02-09 15:54:20Z sloot $
+# $Id: Makefile.am 15946 2013-04-04 12:22:16Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/docs/Makefile.am $
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,10 +39,9 @@ host_triplet = @host@
 subdir = docs
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -76,6 +75,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -171,7 +176,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -181,12 +186,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -233,6 +238,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -242,8 +249,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 ucto_CFLAGS = @ucto_CFLAGS@
 ucto_LIBS = @ucto_LIBS@
-man1_MANS = frog.1 frog-dp-update.1
-EXTRA_DIST = frog.1 frog-dp-update.1
+man1_MANS = frog.1 mbma.1 mblem.1
+EXTRA_DIST = frog.1 mbma.1 mblem.1
 all: all-am
 
 .SUFFIXES:
@@ -314,9 +321,7 @@ uninstall-man1:
 	files=`{ for i in $$list; do echo "$$i"; done; \
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
@@ -384,10 +389,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/docs/frog-dp-update.1 b/docs/frog-dp-update.1
deleted file mode 100644
index ed36f98..0000000
--- a/docs/frog-dp-update.1
+++ /dev/null
@@ -1,29 +0,0 @@
-.TH frog-dp-update 1 "2012 February 9"
-
-.SH NAME
-frog-dp-update - A simple script to install the dependency parser files for frog
-.SH SYNOPSYS
-frog-dp-update
-
-sudo frog-dp-update
-
-.SH DESCRIPTION
-Frog is packed without the (rather large) files for the dependency parser.
-This script will attempt to download them and place them in de frog config 
-directory.
-Also any frog.cfg file found, is backed up to frog.cfg.<n> and replaced with
-a new frog.cfg. This also enables support for IOB chunking.
-
-You might need root privileges, while the frog config can be installed in
-a system directory like /etc/frog
-
-.SH OPTIONS
-none
-
-.SH AUTHORS
-Ko van der Sloot Timbl at uvt.nl
-
-Antal van den Bosch Timbl at uvt.nl
-
-.SH SEE ALSO
-.BR frog (1)
diff --git a/docs/frog.1 b/docs/frog.1
index b7a9cc7..3c1d314 100644
--- a/docs/frog.1
+++ b/docs/frog.1
@@ -53,9 +53,9 @@ send output to 'file' instead of stdout. Defaults to the name of the inputfile w
 send all output to 'dir' instead of stdout. Creates filenames from the inputfilename(s) with '.out' appended.
 .RE
 
-.BR --skip =[mptc]
+.BR --skip =[aclmnpt]
 .RS
-skip parts of the proces: Tokenizer (t), Chunker (c), Multi-Word unit (m) or Parser (p)
+skip parts of the proces: Tokenizer (t), Chunker (c), Lemmatizer (l), Morphological Analyzer (a), Multi-Word unit (m), Named-Entity recognizer (n) or Parser (p)
 .RE
 
 .BR -Q
@@ -77,12 +77,20 @@ process 'file'
 .RS
 process 'xmlfile', which is supposed to be in FoLiA format! If 'xmlfile' is empty, and 
 .BR --testdir =<dir> 
-is provided, all files in 'dir' will be processed as FoLia XML.
+is provided, all '.xml' files in 'dir' will be processed as FoLia XML.
 .RE
 
+.BR --textclass "=<cls>"
+.RS
+When 
+.BR -x
+is given, use 'cls' to find text in the FoLiA document(s).
+.RE
+
+
 .BR --testdir =<dir>
 .RS
-process all files in 'dir'. see also 
+process all files in 'dir'. When the input mode is XML, only '.xml' files are teken from 'dir'. see also 
 .B --outputdir
 .RE
 
@@ -91,6 +99,12 @@ process all files in 'dir'. see also
 location to store intermediate files. Default /tmp.
 .RE
 
+.BR --threads =<n>
+.RS
+use a maximum of 'n' threads. The default is to take whatever is needed.
+In servermode we always run on 1 thread.
+.RE
+
 .BR -V " or " --version
 .RS
 show version info
@@ -98,12 +112,12 @@ show version info
 
 .BR --xmldir =<dir>
 .RS
-generate FoLiA XML output and send it to 'dir'. Creates filenames from the inputfilename with '.xml' appended.
+generate FoLiA XML output and send it to 'dir'. Creates filenames from the inputfilename with '.xml' appended. (Except when it already ends with '.xml')
 .RE
 
 .BR -X " <file>"
 .RS
-generate FoLiA XML output and send it to 'file'. Defaults to the name of the inputfile(s) with '.xml' appended.
+generate FoLiA XML output and send it to 'file'. Defaults to the name of the inputfile(s) with '.xml' appended. (Except when it already ends with '.xml')
 .RE
 
 .BR --id "=<id>"
diff --git a/docs/mblem.1 b/docs/mblem.1
new file mode 100644
index 0000000..af83d3e
--- /dev/null
+++ b/docs/mblem.1
@@ -0,0 +1,48 @@
+.TH mblem 1 "2012 June 27"
+
+.SH NAME
+mblem - Dutch lemmatizer
+.SH SYNOPSYS
+mblem -t test-file
+
+.SH DESCRIPTION
+mblem will tokenize, tag, and lemmatize word tokens in Dutch text files.
+
+.SH OPTIONS
+
+.BR -c " <configfile>"
+.RS
+set the configuration using 'file'
+.RE
+
+.BR -d " <level>"
+.RS
+set debug level.
+.RE
+
+.BR -a
+.RS
+Give ALL analysis, not just the 'best' ones.
+.RE
+
+.BR -h
+.RS
+give some help
+.RE
+
+.BR -t " <file>"
+.RS
+process 'file'
+.RE
+
+.SH BUGS
+likely
+
+.SH AUTHORS
+Ko van der Sloot Timbl at uvt.nl
+
+Antal van den Bosch Timbl at uvt.nl
+
+.SH SEE ALSO
+.BR frog (1)
+.BR mbma (1)
diff --git a/docs/mbma.1 b/docs/mbma.1
new file mode 100644
index 0000000..593df3e
--- /dev/null
+++ b/docs/mbma.1
@@ -0,0 +1,48 @@
+.TH mbma 1 "2012 June 27"
+
+.SH NAME
+mbma - Dutch morphological analyzer
+.SH SYNOPSYS
+mbma -t test-file
+
+.SH DESCRIPTION
+mbma will tokenize, tag, and morphologically segment word tokens in Dutch text files.
+
+.SH OPTIONS
+
+.BR -c " <configfile>"
+.RS
+set the configuration using 'file'
+.RE
+
+.BR -d " <level>"
+.RS
+set debug level.
+.RE
+
+.BR -a
+.RS
+Give ALL analysis, not just the 'best' ones.
+.RE
+
+.BR -h
+.RS
+give some help
+.RE
+
+.BR -t " <file>"
+.RS
+process 'file'
+.RE
+
+.SH BUGS
+likely
+
+.SH AUTHORS
+Ko van der Sloot Timbl at uvt.nl
+
+Antal van den Bosch Timbl at uvt.nl
+
+.SH SEE ALSO
+.BR frog (1)
+.BR mblem (1)
diff --git a/include/Makefile.am b/include/Makefile.am
index 877b8e4..743e0e4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,5 +1,5 @@
 # $Id: Makefile.am 8582 2011-02-27 11:38:10Z joostvb $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/include/Makefile.am $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/Makefile.am $
 
 #AUTOMAKE_OPTIONS = foreign 
 
diff --git a/include/Makefile.in b/include/Makefile.in
index 210f587..1789b73 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # $Id: Makefile.am 8582 2011-02-27 11:38:10Z joostvb $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/include/Makefile.am $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/Makefile.am $
 
 #AUTOMAKE_OPTIONS = foreign 
 VPATH = @srcdir@
@@ -41,10 +41,9 @@ host_triplet = @host@
 subdir = include
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -188,7 +187,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -198,12 +197,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -250,6 +249,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -508,10 +509,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/include/frog/Configuration.h b/include/frog/Configuration.h
deleted file mode 100644
index 08d5be9..0000000
--- a/include/frog/Configuration.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  $Id: Configuration.h 14344 2012-02-27 16:40:05Z sloot $
-  $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/Configuration.h $
-
-  Copyright (c) 2006 - 2012
-  Tilburg University
-
-  This file is part of frog.
-
-  frog 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.
-
-  frog 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 <http://www.gnu.org/licenses/>.
-
-  For questions and suggestions, see:
-      http://ilk.uvt.nl/software.html
-  or send mail to:
-      timbl at uvt.nl
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-class Configuration {
-  typedef std::map<std::string,std::string> ssMap;
-  typedef std::map<std::string, ssMap> sssMap;
-public:
-  bool fill( const std::string& );
-  bool fill( const std::string&, const std::string& );
-  bool hasSection( const std::string& ) const;
-  std::string lookUp( const std::string&, const std::string& = "" ) const;
-  std::string set( const std::string&, 
-		   const std::string&, 
-		   const std::string& = "" );
-  void dump( std::ostream& );
-  std::string configDir() const { return cdir; };
-private:
-  sssMap myMap;
-  std::string cdir;
-};
-
-#endif
diff --git a/include/frog/Frog.h b/include/frog/Frog.h
index 094770d..27932d1 100755
--- a/include/frog/Frog.h
+++ b/include/frog/Frog.h
@@ -1,8 +1,8 @@
 /*
-  $Id: Frog.h 14344 2012-02-27 16:40:05Z sloot $
+  $Id: Frog.h 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/Frog.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
   
   This file is part of frog
@@ -31,37 +31,40 @@
 #define FROG_H
 
 #include <set>
-#include "timbl/LogStream.h"
-#include "libfolia/foliautils.h"
-#include "frog/Configuration.h"
+#include "ticcutils/LogStream.h"
+#include "ticcutils/Configuration.h"
+#include "ticcutils/Timer.h"
+#include "libfolia/document.h"
 
 std::string prefix( const std::string&, const std::string& );
 bool existsDir( const std::string& );
 std::string& trim(std::string &str);
+std::string getTime();
 
-void getFileNames( const std::string&, std::set<std::string>& );
+void getFileNames( const std::string&, const std::string&, 
+		   std::set<std::string>& );
 
-extern LogStream *theErrLog;
+extern TiCC::LogStream *theErrLog;
 
 extern int tpDebug;
-extern Configuration configuration;
+extern TiCC::Configuration configuration;
 
 class TimerBlock{
 public:
-  Common::Timer parseTimer;
-  Common::Timer tokTimer;
-  Common::Timer mblemTimer;
-  Common::Timer mbmaTimer;
-  Common::Timer mwuTimer;
-  Common::Timer tagTimer;
-  Common::Timer iobTimer;
-  Common::Timer nerTimer;
-  Common::Timer prepareTimer;
-  Common::Timer pairsTimer;
-  Common::Timer relsTimer;
-  Common::Timer dirTimer;
-  Common::Timer csiTimer;
-  Common::Timer frogTimer;
+  TiCC::Timer parseTimer;
+  TiCC::Timer tokTimer;
+  TiCC::Timer mblemTimer;
+  TiCC::Timer mbmaTimer;
+  TiCC::Timer mwuTimer;
+  TiCC::Timer tagTimer;
+  TiCC::Timer iobTimer;
+  TiCC::Timer nerTimer;
+  TiCC::Timer prepareTimer;
+  TiCC::Timer pairsTimer;
+  TiCC::Timer relsTimer;
+  TiCC::Timer dirTimer;
+  TiCC::Timer csiTimer;
+  TiCC::Timer frogTimer;
 };
 
 #endif
diff --git a/include/frog/Makefile.am b/include/frog/Makefile.am
index 926b22c..3d4fe19 100644
--- a/include/frog/Makefile.am
+++ b/include/frog/Makefile.am
@@ -1,3 +1,3 @@
 pkginclude_HEADERS = Frog.h  mblem_mod.h  mbma_mod.h  mwu_chunker_mod.h \
-	cgn_tagger_mod.h iob_tagger_mod.h Parser.h Configuration.h \
+	cgn_tagger_mod.h iob_tagger_mod.h Parser.h \
 	ucto_tokenizer_mod.h ner_tagger_mod.h
diff --git a/include/frog/Makefile.in b/include/frog/Makefile.in
index b63ac72..e72bce5 100644
--- a/include/frog/Makefile.in
+++ b/include/frog/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -38,10 +38,9 @@ subdir = include/frog
 DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -75,6 +74,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkgincludedir)"
 HEADERS = $(pkginclude_HEADERS)
 ETAGS = etags
@@ -170,7 +175,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -180,12 +185,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -232,6 +237,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -242,7 +249,7 @@ top_srcdir = @top_srcdir@
 ucto_CFLAGS = @ucto_CFLAGS@
 ucto_LIBS = @ucto_LIBS@
 pkginclude_HEADERS = Frog.h  mblem_mod.h  mbma_mod.h  mwu_chunker_mod.h \
-	cgn_tagger_mod.h iob_tagger_mod.h Parser.h Configuration.h \
+	cgn_tagger_mod.h iob_tagger_mod.h Parser.h \
 	ucto_tokenizer_mod.h ner_tagger_mod.h
 
 all: all-am
@@ -301,9 +308,7 @@ uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -404,10 +409,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/include/frog/Parser.h b/include/frog/Parser.h
index 094bfd8..ab504c0 100644
--- a/include/frog/Parser.h
+++ b/include/frog/Parser.h
@@ -1,8 +1,8 @@
 /*
-  $Id: Parser.h 14447 2012-03-12 16:34:56Z sloot $
+  $Id: Parser.h 15572 2013-01-07 14:59:11Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/Parser.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -31,8 +31,6 @@
 #ifndef PARSER_H
 #define PARSER_H
 
-class Configuration;
-
 class PyObjectRef {
  private:
   PyObject* ref;
@@ -82,11 +80,11 @@ class Parser {
  public:
  Parser():pairs(0),dir(0),rels(0),PI(0),isInit(false),keepIntermediate(false){};
   ~Parser();
-  bool init( const Configuration& );
+  bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& doc ) const;
-  void Parse( folia::Sentence *, 
+  void Parse( const std::vector<folia::Word *>&, 
 	      const std::string&, const std::string&, TimerBlock& );
-  void prepareParse( folia::Sentence *, 
+  void prepareParse( const std::vector<folia::Word *>&, 
 		     const std::string&, parseData& );
   void createParserFile( const parseData& );
  private:
@@ -100,10 +98,11 @@ class Parser {
   PythonInterface *PI;
   bool isInit;
   std::string fileName;
-  LogStream *parseLog;
+  TiCC::LogStream *parseLog;
   bool keepIntermediate;
   std::string version;
   std::string tagset;
+  std::string cgn_tagset;
 
 };
 
diff --git a/include/frog/cgn_tagger_mod.h b/include/frog/cgn_tagger_mod.h
index c460885..e9c9665 100644
--- a/include/frog/cgn_tagger_mod.h
+++ b/include/frog/cgn_tagger_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: cgn_tagger_mod.h 14489 2012-03-22 11:37:02Z sloot $
+  $Id: cgn_tagger_mod.h 15572 2013-01-07 14:59:11Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/cgn_tagger_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -29,16 +29,17 @@
 #ifndef CGN_TAGGER_MOD_H
 #define CGN_TAGGER_MOD_H
 
-class Configuration;
+#include "mbt/MbtAPI.h"
 
 class CGNTagger {
  public:
   CGNTagger();
   ~CGNTagger();
-  bool init( const Configuration& );
+  bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& ) const;
   void addTag( folia::Word *, const std::string&, double );
-  void Classify( folia::Sentence * );
+  void Classify( const std::vector<folia::Word *>& );
+  std::vector<TagResult> tagLine( const std::string& );
   std::string getTagset() const { return tagset; };
  private:
   MbtAPI *tagger;  
diff --git a/include/frog/iob_tagger_mod.h b/include/frog/iob_tagger_mod.h
index 9959f02..32d785b 100644
--- a/include/frog/iob_tagger_mod.h
+++ b/include/frog/iob_tagger_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: iob_tagger_mod.h 14478 2012-03-19 16:10:38Z sloot $
+  $Id: iob_tagger_mod.h 15572 2013-01-07 14:59:11Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/iob_tagger_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -29,23 +29,20 @@
 #ifndef IOB_TAGGER_MOD_H
 #define IOB_TAGGER_MOD_H
 
-class Configuration;
-
 class IOBTagger {
  public:
   IOBTagger();
   ~IOBTagger();
-  bool init( const Configuration& );
+  bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& ) const;
-  void Classify( folia::Sentence * );
+  void Classify( const std::vector<folia::Word *>& );
   std::string getTagset() const { return tagset; };
  private:
   void addChunk( folia::ChunkingLayer *, 
 		 const std::vector<folia::Word*>&,
 		 const std::vector<double>&,
 		 const std::string& );
-  void addIOBTags( folia::Sentence *, 
-		   const std::vector<folia::Word*>&,
+  void addIOBTags( const std::vector<folia::Word*>&,
 		   const std::vector<std::string>&,
 		   const std::vector<double>& );
   MbtAPI *tagger;
diff --git a/include/frog/mblem_mod.h b/include/frog/mblem_mod.h
index 3d3f8d8..d402c01 100755
--- a/include/frog/mblem_mod.h
+++ b/include/frog/mblem_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: mblem_mod.h 14505 2012-03-22 15:33:15Z sloot $
+  $Id: mblem_mod.h 15650 2013-02-07 16:13:55Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/mblem_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -42,15 +42,17 @@ class mblemData {
   std::string tag;
 };
 
-class Configuration;
-
 class Mblem {
  public:
   Mblem();
   ~Mblem();
-  bool init( const Configuration& );
+  bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& doc ) const;
-  std::string Classify( folia::Word * );
+  void Classify( folia::Word * );
+  void Classify( const UnicodeString& );
+  std::vector<std::pair<std::string,std::string> > getResult() const;
+  void filterTag( const std::string&  );
+  void makeUnique();
  private:
   void read_transtable( const std::string& );
   void create_MBlem_defaults();
@@ -58,7 +60,7 @@ class Mblem {
   void addLemma( folia::FoliaElement *, const std::string&);
   void addAltLemma( folia::Word *, const std::string&);
   std::string make_instance( const UnicodeString& in );
-  std::string postprocess( folia::Word * );
+  void getFoLiAResult( folia::Word *, const UnicodeString& );
   Timbl::TimblAPI *myLex;
   std::string punctuation;
   size_t history;
@@ -67,7 +69,8 @@ class Mblem {
   std::vector<mblemData> mblemResult;
   std::string version;
   std::string tagset;
-  LogStream *mblemLog;
+  std::string cgn_tagset;
+  TiCC::LogStream *mblemLog;
 };
 
 #endif
diff --git a/include/frog/mbma_mod.h b/include/frog/mbma_mod.h
index 1d3d10a..7e5ea3d 100755
--- a/include/frog/mbma_mod.h
+++ b/include/frog/mbma_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: mbma_mod.h 14478 2012-03-19 16:10:38Z sloot $
+  $Id: mbma_mod.h 15572 2013-01-07 14:59:11Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/mbma_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
   
   This file is part of frog.
@@ -29,6 +29,8 @@
 #ifndef MBMA_MOD_H
 #define MBMA_MOD_H
 
+#include <unicode/translit.h>
+
 class MBMAana;
 
 struct waStruct {
@@ -40,27 +42,31 @@ struct waStruct {
   }
 };
 
-class Configuration;
-
 class Mbma {
  public:
   Mbma();
   ~Mbma();
-  bool init( const Configuration& );
+  bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& doc ) const;
-  bool Classify( folia::Word * );
-  std::string getIname( char ) const;
+  void Classify( folia::Word * );
+  void Classify( const UnicodeString& );
+  void filterTag( const std::string&, const std::vector<std::string>& );
+  std::vector<std::vector<std::string> > getResult() const;
  private:
   void cleanUp();
   bool readsettings( const std::string&, const std::string& );
   void fillMaps();
   void init_cgn( const std::string& );
+  void init_filter( );
+  UnicodeString filterDiacritics( const UnicodeString& ) const;
+  void getFoLiAResult( folia::Word *, const UnicodeString& ) const;
   std::vector<std::string> make_instances( const UnicodeString& word );
   std::string calculate_ins_del( const std::string& in_class, 
 				 std::string& deletestring,
-				 std::string& insertstring );
+				 std::string& insertstring,
+				 bool& );
   std::vector<waStruct> Step1( unsigned int step, 
-			       const UnicodeString& word, int nranal,
+			       const UnicodeString& word, 
 			       const std::vector<std::vector<std::string> >& classParts,
 			       const std::string& basictags );
   void resolve_inflections( std::vector<waStruct>& , const std::string& );
@@ -70,9 +76,11 @@ class Mbma {
   MBMAana inflectAndAffix( const std::vector<waStruct>& ana );
   void execute( const UnicodeString& word, 
 		const std::vector<std::string>& classes );
-  void postprocess( folia::Word *, folia::PosAnnotation * );
   int debugFlag;
-  void addMorph( folia::Word *, const std::vector<std::string>& );
+  void addMorph( folia::MorphologyLayer *, 
+		 const std::vector<std::string>& ) const;
+  void addMorph( folia::Word *, const std::vector<std::string>& ) const;
+  void addAltMorph( folia::Word *, const std::vector<std::string>& ) const;
   std::string MTreeFilename;
   Timbl::TimblAPI *MTree;
   std::map<char,std::string> iNames;  
@@ -81,11 +89,14 @@ class Mbma {
   std::vector<MBMAana> analysis;
   std::string version;
   std::string tagset;
-  LogStream *mbmaLog;
+  std::string cgn_tagset;
+  TiCC::LogStream *mbmaLog;
+  Transliterator *transliterator;
 };
 
 class MBMAana {
   friend std::ostream& operator<< ( std::ostream& , const MBMAana& );
+  friend std::ostream& operator<< ( std::ostream& , const MBMAana* );
   public:
   MBMAana() {
     tag = "";
diff --git a/include/frog/mwu_chunker_mod.h b/include/frog/mwu_chunker_mod.h
index 3ebcecb..82ab8d2 100755
--- a/include/frog/mwu_chunker_mod.h
+++ b/include/frog/mwu_chunker_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: mwu_chunker_mod.h 14478 2012-03-19 16:10:38Z sloot $
+  $Id: mwu_chunker_mod.h 15877 2013-04-02 15:57:51Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/mwu_chunker_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
   
   This file is part of frog.
@@ -29,8 +29,6 @@
 #ifndef MWU_CHUNKER_H
 #define MWU_CHUNKER_H
 
-#include "libfolia/folia.h"
-
 class mwuAna {
   friend std::ostream& operator<< (std::ostream&, const mwuAna& );
  public:
@@ -57,17 +55,15 @@ class mwuAna {
 
 #define mymap2 std::multimap<std::string, std::vector<std::string> >
 
-class Configuration;
-
 class Mwu {
   friend std::ostream& operator<< (std::ostream&, const Mwu& );
  public:
   Mwu();
   ~Mwu();
   void reset();
-  bool init( const Configuration& );
+  bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& ) const;
-  void Classify( folia::Sentence * );
+  void Classify( const std::vector<folia::Word *>& );
   void add( folia::Word * );
   std::string getTagset() const { return tagset; };
   std::vector<mwuAna*>& getAna(){ return mWords; };
@@ -79,7 +75,7 @@ class Mwu {
   std::string mwuFileName;
   std::vector<mwuAna*> mWords;
   mymap2 MWUs;
-  LogStream *mwuLog;
+  TiCC::LogStream *mwuLog;
   std::string version;
   std::string tagset;
 };
diff --git a/include/frog/ner_tagger_mod.h b/include/frog/ner_tagger_mod.h
index 253c49b..6d361ff 100644
--- a/include/frog/ner_tagger_mod.h
+++ b/include/frog/ner_tagger_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: ner_tagger_mod.h 14447 2012-03-12 16:34:56Z sloot $
+  $Id: ner_tagger_mod.h 15572 2013-01-07 14:59:11Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/ner_tagger_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -29,17 +29,14 @@
 #ifndef NER_TAGGER_MOD_H
 #define NER_TAGGER_MOD_H
 
-class Configuration;
-
 class NERTagger {
  public:
   NERTagger();
   ~NERTagger();
-  bool init( const Configuration& );
-  void Classify( folia::Sentence * );
+  bool init( const TiCC::Configuration& );
+  void Classify( const std::vector<folia::Word *>& );
   void addDeclaration( folia::Document& ) const;
-  void addNERTags( folia::Sentence *, 
-		   const std::vector<folia::Word*>&,
+  void addNERTags( const std::vector<folia::Word*>&,
 		   const std::vector<std::string>&,
 		   const std::vector<double>& );
   std::string getTagset() const { return tagset; };
diff --git a/include/frog/ucto_tokenizer_mod.h b/include/frog/ucto_tokenizer_mod.h
index 99a2ca7..f2725e7 100644
--- a/include/frog/ucto_tokenizer_mod.h
+++ b/include/frog/ucto_tokenizer_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: ucto_tokenizer_mod.h 14267 2012-02-15 13:05:47Z sloot $
+  $Id: ucto_tokenizer_mod.h 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/ucto_tokenizer_mod.h $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
   
   This file is part of frog.
@@ -29,25 +29,25 @@
 #ifndef UCTO_TOKENIZER_MOD_H
 #define UCTO_TOKENIZER_MOD_H
 
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
 #include "ucto/tokenize.h"
 
-class Configuration;
-
 class UctoTokenizer {
  public:
   UctoTokenizer();
   ~UctoTokenizer() { delete tokenizer; delete uctoLog; };
-  bool init( const Configuration&, const std::string&, bool );
+  bool init( const TiCC::Configuration&, const std::string&, bool );
+  void setUttMarker( const std::string& );
   void setSentencePerLineInput( bool );
-  void setInputEncoding( const std::string & );
+  void setInputEncoding( const std::string& );
+  void setQuoteDetection( bool );
   void setInputXml( bool );
+  void setTextClass( const std::string& );
   folia::Document tokenize( std::istream& );
   bool tokenize( folia::Document& );
+  std::vector<std::string> tokenize( const std::string&  );
  private:
   Tokenizer::TokenizerClass *tokenizer;
-  LogStream *uctoLog;
+  TiCC::LogStream *uctoLog;
 };
 
 #endif 
diff --git a/ltmain.sh b/ltmain.sh
old mode 100755
new mode 100644
index b4a3231..c2852d8
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,9 +1,9 @@
 
-# libtool (GNU libtool) 2.4
+# libtool (GNU libtool) 2.4.2
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -41,6 +41,7 @@
 #       --quiet, --silent    don't print informational messages
 #       --no-quiet, --no-silent
 #                            print informational messages (default)
+#       --no-warn            don't display warning messages
 #       --tag=TAG            use configuration variables from tag TAG
 #   -v, --verbose            print more informational messages than default
 #       --no-verbose         don't print the extra informational messages
@@ -69,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4 Debian-2.4-2ubuntu1
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -79,9 +80,9 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4 Debian-2.4-2ubuntu1"
+VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
 TIMESTAMP=""
-package_revision=1.3293
+package_revision=1.3337
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -136,15 +137,10 @@ progpath="$0"
 
 : ${CP="cp -f"}
 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="/bin/sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -387,7 +383,7 @@ case $progpath in
      ;;
   *)
      save_IFS="$IFS"
-     IFS=:
+     IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
        IFS="$save_IFS"
        test -x "$progdir/$progname" && break
@@ -771,8 +767,8 @@ func_help ()
 	s*\$LTCFLAGS*'"$LTCFLAGS"'*
 	s*\$LD*'"$LD"'*
 	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
 	p
 	d
      }
@@ -1052,6 +1048,7 @@ opt_finish=false
 opt_help=false
 opt_help_all=false
 opt_silent=:
+opt_warning=:
 opt_verbose=:
 opt_silent=false
 opt_verbose=false
@@ -1120,6 +1117,10 @@ esac
 			opt_silent=false
 func_append preserve_args " $opt"
 			;;
+      --no-warning|--no-warn)
+			opt_warning=false
+func_append preserve_args " $opt"
+			;;
       --no-verbose)
 			opt_verbose=false
 func_append preserve_args " $opt"
@@ -2059,7 +2060,7 @@ func_mode_compile ()
     *.[cCFSifmso] | \
     *.ada | *.adb | *.ads | *.asm | \
     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
       func_xform "$libobj"
       libobj=$func_xform_result
       ;;
@@ -3201,11 +3202,13 @@ func_mode_install ()
 
       # Set up the ranlib parameters.
       oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
 
       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
 
       if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $oldlib" 'exit $?'
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
       fi
 
       # Do each command in the postinstall commands.
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() {
 	  # linked before any other PIC object.  But we must not use
 	  # pic_flag when linking with -static.  The problem exists in
 	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
@@ -3982,14 +3985,17 @@ func_exec_program_core ()
 # launches target application with the remaining arguments.
 func_exec_program ()
 {
-  for lt_wr_arg
-  do
-    case \$lt_wr_arg in
-    --lt-*) ;;
-    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-    esac
-    shift
-  done
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
   func_exec_program_core \${1+\"\$@\"}
 }
 
@@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f)
 {
 EOF
 	    func_emit_wrapper yes |
-              $SED -e 's/\([\\"]\)/\\\1/g' \
-	           -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
-
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
             cat <<"EOF"
 }
 EOF
@@ -5643,7 +5655,8 @@ func_mode_link ()
 	continue
 	;;
 
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 	func_append compiler_flags " $arg"
 	func_append compile_command " $arg"
 	func_append finalize_command " $arg"
@@ -6150,7 +6163,8 @@ func_mode_link ()
 	lib=
 	found=no
 	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
@@ -6834,7 +6848,7 @@ func_mode_link ()
 	         test "$hardcode_direct_absolute" = no; then
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
+		add_dir="-L$absdir"
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -7319,6 +7333,7 @@ func_mode_link ()
 	  # which has an extra 1 added just for fun
 	  #
 	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
 	  darwin|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
@@ -7438,7 +7453,7 @@ func_mode_link ()
 	  versuffix="$major.$revision"
 	  ;;
 
-	linux)
+	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
@@ -8026,6 +8041,11 @@ EOF
 
       # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then
+	# Remove ${wl} instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
 	if test "$hardcode_into_libs" = yes; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
@@ -8056,7 +8076,7 @@ EOF
 	    elif test -n "$runpath_var"; then
 	      case "$perm_rpath " in
 	      *" $libdir "*) ;;
-	      *) func_apped perm_rpath " $libdir" ;;
+	      *) func_append perm_rpath " $libdir" ;;
 	      esac
 	    fi
 	  done
@@ -8064,11 +8084,7 @@ EOF
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-	    else
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-	    fi
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
@@ -9158,6 +9174,8 @@ EOF
 	    esac
 	  done
 	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
 	eval cmds=\"$old_archive_cmds\"
 
 	func_len " $cmds"
@@ -9267,7 +9285,8 @@ EOF
 	      *.la)
 		func_basename "$deplib"
 		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		func_resolve_sysroot "$deplib"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
diff --git a/m4/Makefile.am b/m4/Makefile.am
index e3a69f2..58d9377 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,5 +1,5 @@
 # $Id: Makefile.am 8582 2011-02-27 11:38:10Z joostvb $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/m4/Makefile.am $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/m4/Makefile.am $
 
 extra_DIST = ax_icu_check.m4 ax_boost_base.m4 ax_boost_filesystem.m4 \
 	ac_python_devel.m4 ax_openmp.m4
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 63da2dc..3a37fee 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # $Id: Makefile.am 8582 2011-02-27 11:38:10Z joostvb $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/m4/Makefile.am $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/m4/Makefile.am $
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -39,10 +39,9 @@ host_triplet = @host@
 subdir = m4
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -146,7 +145,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -156,12 +155,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -208,6 +207,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -310,10 +311,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4
deleted file mode 100644
index 8594947..0000000
--- a/m4/ac_define_dir.m4
+++ /dev/null
@@ -1,45 +0,0 @@
-# ===========================================================================
-#             http://autoconf-archive.cryp.to/ac_define_dir.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
-#
-# DESCRIPTION
-#
-#   This macro sets VARNAME to the expansion of the DIR variable, taking
-#   care of fixing up ${prefix} and such.
-#
-#   VARNAME is then offered as both an output variable and a C preprocessor
-#   symbol.
-#
-#   Example:
-#
-#      AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Stepan Kasal <kasal at ucw.cz>
-#   Copyright (c) 2008 Andreas Schwab <schwab at suse.de>
-#   Copyright (c) 2008 Guido U. Draheim <guidod at gmx.de>
-#   Copyright (c) 2008 Alexandre Oliva
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved.
-
-AC_DEFUN([AC_DEFINE_DIR], [
-  prefix_NONE=
-  exec_prefix_NONE=
-  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
-  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
-dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
-dnl refers to ${prefix}.  Thus we have to use `eval' twice.
-  eval ac_define_dir="\"[$]$2\""
-  eval ac_define_dir="\"$ac_define_dir\""
-  AC_SUBST($1, "$ac_define_dir")
-  AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
-  test "$prefix_NONE" && prefix=NONE
-  test "$exec_prefix_NONE" && exec_prefix=NONE
-])
diff --git a/m4/acx_pthread.m4 b/m4/ax_pthread.m4
similarity index 74%
rename from m4/acx_pthread.m4
rename to m4/ax_pthread.m4
index 0a86dff..a6bf596 100644
--- a/m4/acx_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -1,10 +1,10 @@
 # ===========================================================================
-#              http://autoconf-archive.cryp.to/acx_pthread.html
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
 # ===========================================================================
 #
 # SYNOPSIS
 #
-#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
 #
 # DESCRIPTION
 #
@@ -25,14 +25,18 @@
 #   If you are only building threads programs, you may wish to use these
 #   variables in your default LIBS, CFLAGS, and CC:
 #
-#          LIBS="$PTHREAD_LIBS $LIBS"
-#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-#          CC="$PTHREAD_CC"
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
 #
 #   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
 #   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
 #   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
 #
+#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+#   PTHREAD_CFLAGS.
+#
 #   ACTION-IF-FOUND is a list of shell commands to run if a threads library
 #   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
 #   is not found. If ACTION-IF-FOUND is not specified, the default action
@@ -45,9 +49,12 @@
 #   Alejandro Forero Cuervo to the autoconf macro repository. We are also
 #   grateful for the helpful feedback of numerous users.
 #
+#   Updated for Autoconf 2.68 by Daniel Richard G.
+#
 # LICENSE
 #
 #   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
+#   Copyright (c) 2011 Daniel Richard G. <skunk at iSKUNK.ORG>
 #
 #   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
@@ -75,11 +82,13 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-AC_DEFUN([ACX_PTHREAD], [
+#serial 16
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
 AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
-acx_pthread_ok=no
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
 
 # We used to check for pthread.h first, but this fails if pthread.h
 # requires special compiler flags (e.g. on True64 or Sequent).
@@ -94,9 +103,9 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
-        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test x"$acx_pthread_ok" = xno; then
+        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test x"$ax_pthread_ok" = xno; then
                 PTHREAD_LIBS=""
                 PTHREAD_CFLAGS=""
         fi
@@ -114,7 +123,7 @@ fi
 # which indicates that we try without any flags at all, and "pthread-config"
 # which is a program returning the flags for the Pth emulation library.
 
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
 
 # The ordering *is* (sometimes) important.  Some notes on the
 # individual items follow:
@@ -147,12 +156,16 @@ case "${host_cpu}-${host_os}" in
         # who knows whether they'll stub that too in a future libc.)  So,
         # we'll just look for -pthreads and -lpthread first:
 
-        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+        *-darwin*)
+        ax_pthread_flags="-pthread $ax_pthread_flags"
         ;;
 esac
 
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
 
         case $flag in
                 none)
@@ -164,12 +177,12 @@ for flag in $acx_pthread_flags; do
                 PTHREAD_CFLAGS="$flag"
                 ;;
 
-		pthread-config)
-		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
-		if test x"$acx_pthread_config" = xno; then continue; fi
-		PTHREAD_CFLAGS="`pthread-config --cflags`"
-		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
-		;;
+                pthread-config)
+                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+                if test x"$ax_pthread_config" = xno; then continue; fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
 
                 *)
                 AC_MSG_CHECKING([for the pthreads library -l$flag])
@@ -191,17 +204,23 @@ for flag in $acx_pthread_flags; do
         # pthread_cleanup_push because it is one of the few pthread
         # functions on Solaris that doesn't have a non-functional libc stub.
         # We try pthread_create on general principles.
-        AC_TRY_LINK([#include <pthread.h>],
-                    [pthread_t th; pthread_join(th, 0);
-                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
-                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
-                    [acx_pthread_ok=yes])
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }],
+                       [pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */])],
+                [ax_pthread_ok=yes],
+                [])
 
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test "x$acx_pthread_ok" = xyes; then
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test "x$ax_pthread_ok" = xyes; then
                 break;
         fi
 
@@ -211,19 +230,21 @@ done
 fi
 
 # Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
+if test "x$ax_pthread_ok" = xyes; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         save_CFLAGS="$CFLAGS"
         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
-	AC_MSG_CHECKING([for joinable pthread attribute])
-	attr_name=unknown
-	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
-	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
-                        [attr_name=$attr; break])
-	done
+        AC_MSG_CHECKING([for joinable pthread attribute])
+        attr_name=unknown
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
+                           [int attr = $attr; return attr /* ; */])],
+                [attr_name=$attr; break],
+                [])
+        done
         AC_MSG_RESULT($attr_name)
         if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
             AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
@@ -242,15 +263,25 @@ if test "x$acx_pthread_ok" = xyes; then
             PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
         fi
 
+        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+            ax_cv_PTHREAD_PRIO_INHERIT, [
+                AC_LINK_IFELSE([
+                    AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
+                    [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+                    [ax_cv_PTHREAD_PRIO_INHERIT=no])
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
+            AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
+
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
         # More AIX lossage: must compile with xlc_r or cc_r
-	if test x"$GCC" != xyes; then
+        if test x"$GCC" != xyes; then
           AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
         else
           PTHREAD_CC=$CC
-	fi
+        fi
 else
         PTHREAD_CC="$CC"
 fi
@@ -260,12 +291,12 @@ AC_SUBST(PTHREAD_CFLAGS)
 AC_SUBST(PTHREAD_CC)
 
 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
+if test x"$ax_pthread_ok" = xyes; then
         ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
         :
 else
-        acx_pthread_ok=no
+        ax_pthread_ok=no
         $2
 fi
-AC_LANG_RESTORE
-])dnl ACX_PTHREAD
+AC_LANG_POP
+])dnl AX_PTHREAD
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index 9c7b5d4..07a8602 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3293 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4])
-m4_define([LT_PACKAGE_REVISION], [1.3293])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4'
-macro_revision='1.3293'
+[macro_version='2.4.2'
+macro_revision='1.3337'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index 31169b4..9a71878 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -26,7 +26,8 @@
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -72,7 +73,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -120,9 +122,9 @@ if test $pkg_failed = yes; then
    	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
diff --git a/missing b/missing
index 28055d2..86a8fc3 100755
--- a/missing
+++ b/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.13; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,6 @@ Supported PROGRAM values:
   help2man     touch the output file
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
@@ -122,15 +121,6 @@ case $1 in
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
@@ -226,7 +216,7 @@ WARNING: \`$1' $msg.  You should only need it if
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +246,7 @@ WARNING: \`$1' is $msg.  You should only need it if
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -318,41 +308,6 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and is $msg.
diff --git a/py-compile b/py-compile
index 3f9d05b..15c834c 100755
--- a/py-compile
+++ b/py-compile
@@ -1,10 +1,10 @@
 #!/bin/sh
 # py-compile - Compile a Python program
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-06-08.12; # UTC
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free
+# Software Foundation, Inc.
 
 # 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
@@ -32,28 +32,36 @@ if [ -z "$PYTHON" ]; then
   PYTHON=python
 fi
 
+me=py-compile
+
+usage_error ()
+{
+  echo "$me: $*" >&2
+  echo "Try \`$me --help' for more information." >&2
+  exit 1
+}
+
 basedir=
 destdir=
-files=
 while test $# -ne 0; do
   case "$1" in
     --basedir)
-      basedir=$2
-      if test -z "$basedir"; then
-        echo "$0: Missing argument to --basedir." 1>&2
-        exit 1
+      if test $# -lt 2; then
+        usage_error "option '--basedir' requires an argument"
+      else
+        basedir=$2
       fi
       shift
       ;;
     --destdir)
-      destdir=$2
-      if test -z "$destdir"; then
-        echo "$0: Missing argument to --destdir." 1>&2
-        exit 1
+      if test $# -lt 2; then
+        usage_error "option '--destdir' requires an argument"
+      else
+        destdir=$2
       fi
       shift
       ;;
-    -h|--h*)
+    -h|--help)
       cat <<\EOF
 Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
 
@@ -69,20 +77,27 @@ Report bugs to <bug-automake at gnu.org>.
 EOF
       exit $?
       ;;
-    -v|--v*)
-      echo "py-compile $scriptversion"
+    -v|--version)
+      echo "$me $scriptversion"
       exit $?
       ;;
+    --)
+      shift
+      break
+      ;;
+    -*)
+      usage_error "unrecognized option '$1'"
+      ;;
     *)
-      files="$files $1"
+      break
       ;;
   esac
   shift
 done
 
+files=$*
 if test -z "$files"; then
-    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
-    exit 1
+    usage_error "no files given"
 fi
 
 # if basedir was given, then it should be prepended to filenames before
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 944390d..adfcdc8 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,5 +1,5 @@
 # $Id: Makefile.am 8890 2011-03-16 16:00:25Z sloot $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/scripts/Makefile.am $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/scripts/Makefile.am $
 
 frogscripts_PYTHON = csidp.py dir.py pairs.py rels.py common.py cky.py \
 	deptree.py csiparse2.py sentences.py cmdline.py
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 3f020b8..fbef9db 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # $Id: Makefile.am 8890 2011-03-16 16:00:25Z sloot $
-# $URL: https://ilk.uvt.nl/svn/trunk/sources/Frog/trunk/scripts/Makefile.am $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/scripts/Makefile.am $
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -40,10 +40,9 @@ subdir = scripts
 DIST_COMMON = $(frogscripts_PYTHON) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -77,6 +76,13 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
 am__installdirs = "$(DESTDIR)$(frogscriptsdir)"
 py_compile = $(top_srcdir)/py-compile
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -170,7 +176,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -180,12 +186,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -232,6 +238,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -302,11 +310,8 @@ install-frogscriptsPYTHON: $(frogscripts_PYTHON)
 	  $(INSTALL_DATA) $$files "$(DESTDIR)$(frogscriptsdir)" || exit $$?; \
 	done || exit $$?; \
 	if test -n "$$dlist"; then \
-	  if test -z "$(DESTDIR)"; then \
-	    PYTHON=$(PYTHON) $(py_compile) --basedir "$(frogscriptsdir)" $$dlist; \
-	  else \
-	    PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(frogscriptsdir)" $$dlist; \
-	  fi; \
+	  $(am__py_compile) --destdir "$(DESTDIR)" \
+	                    --basedir "$(frogscriptsdir)" $$dlist; \
 	else :; fi
 
 uninstall-frogscriptsPYTHON:
@@ -314,14 +319,14 @@ uninstall-frogscriptsPYTHON:
 	@list='$(frogscripts_PYTHON)'; test -n "$(frogscriptsdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	test -n "$$files" || exit 0; \
+	dir='$(DESTDIR)$(frogscriptsdir)'; \
 	filesc=`echo "$$files" | sed 's|$$|c|'`; \
 	fileso=`echo "$$files" | sed 's|$$|o|'`; \
-	echo " ( cd '$(DESTDIR)$(frogscriptsdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(frogscriptsdir)" && rm -f $$files || exit $$?; \
-	echo " ( cd '$(DESTDIR)$(frogscriptsdir)' && rm -f" $$filesc ")"; \
-	cd "$(DESTDIR)$(frogscriptsdir)" && rm -f $$filesc || exit $$?; \
-	echo " ( cd '$(DESTDIR)$(frogscriptsdir)' && rm -f" $$fileso ")"; \
-	cd "$(DESTDIR)$(frogscriptsdir)" && rm -f $$fileso
+	st=0; \
+	for files in "$$files" "$$filesc" "$$fileso"; do \
+	  $(am__uninstall_files_from_dir) || st=$$?; \
+	done; \
+	exit $$st
 tags: TAGS
 TAGS:
 
@@ -376,10 +381,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/Configuration.cxx b/src/Configuration.cxx
deleted file mode 100644
index 995cae8..0000000
--- a/src/Configuration.cxx
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
-  $Id: Configuration.cxx 14344 2012-02-27 16:40:05Z sloot $
-  $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Configuration.cxx $
-  Copyright (c) 2006 - 2012
-  Tilburg University
-
-  This file is part of frog.
-
-  frog 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.
-
-  frog 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 <http://www.gnu.org/licenses/>.
-
-  For questions and suggestions, see:
-      http://ilk.uvt.nl/software.html
-  or send mail to:
-      timbl at uvt.nl
-*/
-
-#include <string>
-#include <map>
-#include <fstream>
-#include <iostream>
-#include "timbl/StringOps.h"
-#include "frog/Configuration.h"
-
-
-using namespace std;
-
-string dirname( const string& f ){
-  string::size_type pos = f.find_last_of("/");
-  if ( pos != string::npos ){
-    return f.substr( 0, pos+1 );
-  }
-  else 
-    return ".";
-}
-
-string fixControl( const string& s, char c ){
-  string sString;
-  string rString;
-  switch ( c ){
-  case 't':
-    sString = "\\t";
-    rString = "\t";
-    break;
-  case 'r': 
-    sString = "\\r";
-    rString = "\r";
-    break;
-  case 'n': 
-    sString = "\\n";
-    rString = "\n";
-    break;
-  default:
-    throw logic_error("invalid char for fixControl" );
-  }
-  string::size_type pos1 = s.find( sString );
-  if ( pos1 == string::npos ){
-    return s;
-  }
-  else {
-    string result = s.substr( 0, pos1 );
-    result += rString;
-    string::size_type pos2 = s.find( sString, pos1+1 );
-    while ( pos2 != string::npos ){
-      result += s.substr( pos1+2, pos2-pos1-2 );
-      result += rString;
-      pos1 = pos2;
-      pos2 = s.find( sString, pos1+1 );
-    }
-    result += s.substr( pos1+2 );
-    return result;
-  }
-}
-
-string fixControls( const string& s ){
-  string result = s;
-  result = fixControl( result, 'n' );
-  result = fixControl( result, 'r' );
-  result = fixControl( result, 't' );
-  return result;
-}
-
-bool Configuration::fill( const string& fileName ){
-  cdir = dirname( fileName );
-  //  cerr << "dirname= " << cdir << endl;
-  ifstream is( fileName.c_str() );
-  if ( !is ){
-    cerr << "unable to read configuration from " << fileName << endl;
-    return false;
-  }
-  string inLine;
-  string section = "global";
-  while ( getline( is, inLine ) ){
-    string line = Timbl::compress(inLine);
-    if ( line.empty() )
-      continue;
-    if ( line[0] == '#' )
-      continue;
-    if ( line.find( "[[") == 0  ) 
-      if ( line[line.length()-1] == ']' &&
-	   line[line.length()-2] == ']' ){
-	section = line.substr(2,line.length()-4);
-	//	cerr << "GOT section = " << section << endl;
-      }
-      else {
-	cerr << "invalid section: in line '" << line << "'" << endl;
-	return false;
-      }
-    else {
-      vector<string> parts;
-      int num = Timbl::split_at( line, parts, "=" );
-      if ( num == 2 ){
-	string val = parts[1];
-	if ( val[0] == '"' && val[val.length()-1] == '"' )
-	  val = val.substr(1, val.length()-2);
-	val = fixControls( val );
-	myMap[section][parts[0]] = val;
-	if ( section == "global" 
-	     && parts[0] == "configDir" )
-	  cdir = val;
-      }
-      else {
-	cerr << "invalid attribute value pair in line '" << line << "'" << endl;
-	return false;
-      }
-    }
-  }
-  return true;
-}
-
-bool Configuration::fill( const string& fileName, const string& section ){
-  ifstream is( fileName.c_str() );
-  if ( !is ){
-    cerr << "unable to read configuration from " << fileName << endl;
-    return false;
-  }
-  bool found = false;
-  string inLine;
-  string localsection;
-  //  cerr << "looking for section = " << section << endl;
-  while ( getline( is, inLine ) ){
-    string line = Timbl::compress(inLine);
-    if ( line.empty() )
-      continue;
-    if ( line[0] == '#' )
-      continue;
-    if ( line.find( "[[") == 0  ) 
-      if ( line[line.length()-1] == ']' &&
-	   line[line.length()-2] == ']' ){
-	localsection = line.substr(2,line.length()-4);
-	//	cerr << "GOT section = " << localsection << endl;
-      }
-      else {
-	cerr << "invalid section: in line '" << line << "'" << endl;
-	return false;
-      }
-    else if ( localsection == section ){
-      found = true;
-      vector<string> parts;
-      int num = Timbl::split_at( line, parts, "=" );
-      if ( num == 2 ){
-	string val = parts[1];
-	if ( val[0] == '"' && val[val.length()-1] == '"' )
-	  val = val.substr(1, val.length()-2);
-	myMap[section][parts[0]] = val;
-      }
-      else {
-	cerr << "invalid attribute value pair in line '" << line << "'" << endl;
-	return false;
-      }
-    }
-  }
-  if ( !found ){
-    cerr << "unable to find a section [[" << section << "]] in file: "
-	 << fileName << endl;
-    return false;
-  }
-  return true;
-}
-
-void Configuration::dump( ostream& os ){
-  sssMap::const_iterator it1 = myMap.find("global");
-  os << "[global]" << endl;
-  os << "configDir=" << cdir << endl;
-  ssMap::const_iterator it2 = it1->second.begin();
-  while ( it2 != it1->second.end() ){
-    os << it2->first << "=" << it2->second << endl;
-    ++it2;
-  }
-  it1 = myMap.begin();
-  while ( it1 != myMap.end() ){
-    if ( it1->first != "global" ){
-      os << "[" << it1->first << "]" << endl;
-      it2 = it1->second.begin();
-      while ( it2 != it1->second.end() ){
-	os << it2->first << "=" << it2->second << endl;
-	++it2;
-      }
-    }
-    ++it1;
-  }
-}
-
-std::string Configuration::set( const string& att, 
-				const string& val,
-				const std::string& sect ){
-  string oldVal;
-  string section = sect;
-  if ( section.empty() )
-    section = "global";
-  sssMap::iterator it1 = myMap.find( section );
-  if ( it1 != myMap.end() ){
-    ssMap::iterator it2 = it1->second.find( att );
-    if ( it2 != it1->second.end() ){
-      oldVal = it2->second;
-    }
-    it1->second[att] = val;
-  }
-  return oldVal;
-}
-
-string Configuration::lookUp( const string& att, const string& section ) const {
-  sssMap::const_iterator it1;
-  if ( section.empty() )
-    it1 = myMap.find( "global" );
-  else
-    it1 = myMap.find( section );
-  if ( it1 == myMap.end() ){
-    return "";
-  }
-  else {
-    ssMap::const_iterator it2 = it1->second.find( att );
-    if ( it2 == it1->second.end() ){
-      if ( section.empty() || section == "global" )
-	return "";
-      else
-	return lookUp( att, "global" );
-    }
-    else
-      return it2->second;
-  }
-}
-
-bool Configuration::hasSection( const string& section ) const {
-  if ( !section.empty() ){
-    sssMap::const_iterator it1 = myMap.find( section );
-    if ( it1 != myMap.end() )
-      return true;
-  }
-  return false;
-}
diff --git a/src/Frog-util.cxx b/src/Frog-util.cxx
index 093382e..941ee91 100755
--- a/src/Frog-util.cxx
+++ b/src/Frog-util.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: Frog-util.cxx 14344 2012-02-27 16:40:05Z sloot $
+  $Id: Frog-util.cxx 15572 2013-01-07 14:59:11Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Frog-util.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog
@@ -61,7 +61,9 @@ bool existsDir( const string& dirName ){
   return result;
 }
 
-void getFileNames( const string& dirName, set<string>& fileNames ){
+void getFileNames( const string& dirName,
+		   const string& ext, 
+		   set<string>& fileNames ){
   DIR *dir = opendir( dirName.c_str() );
   if ( !dir )
     return;
@@ -69,14 +71,18 @@ void getFileNames( const string& dirName, set<string>& fileNames ){
     struct stat sb;
     struct dirent *entry = readdir( dir );
     while ( entry ){
-      if (entry->d_name[0] != '.') {
-        string fullName = dirName + "/" + entry->d_name;
-        if ( stat( fullName.c_str(), &sb ) >= 0 ){
+      if ( entry->d_name[0] != '.' ) {
+	string filename = entry->d_name;
+	if ( ext.empty() ||
+	     filename.rfind( ext ) != string::npos ) {
+	  string fullName = dirName + "/" + filename;
+	  if ( stat( fullName.c_str(), &sb ) >= 0 ){
             if ( (sb.st_mode & S_IFMT) == S_IFREG )
-                fileNames.insert( entry->d_name );
-        }
-       }
-       entry = readdir( dir );
+	      fileNames.insert( entry->d_name );
+	  }
+	}
+      }
+      entry = readdir( dir );
     }
     closedir( dir );
   }
@@ -101,3 +107,13 @@ string& trim(string &str)  //3rd party function. TODO: test if utf-8 safe? (MvG)
     return str;
 }
 
+string getTime() {
+  time_t Time;
+  time(&Time);
+  tm curtime;
+  localtime_r(&Time,&curtime);
+  char buf[256];
+  strftime( buf, 100, "%Y-%m-%dT%X", &curtime );
+  string res = buf;
+  return res;
+}
diff --git a/src/Frog.cxx b/src/Frog.cxx
index 269e8f9..98b8485 100755
--- a/src/Frog.cxx
+++ b/src/Frog.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: Frog.cxx 14574 2012-03-28 13:38:44Z sloot $
+  $Id: Frog.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Frog.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -49,9 +49,7 @@
 
 #include "config.h"
 #include "frog/Frog.h"
-#include "frog/Configuration.h"
-#include "libfolia/document.h"
-#include "libfolia/folia.h"
+#include "ticcutils/Configuration.h"
 #include "frog/ucto_tokenizer_mod.h"
 #include "frog/mbma_mod.h"
 #include "frog/mblem_mod.h"
@@ -63,6 +61,7 @@
 
 using namespace std;
 using namespace folia;
+using namespace TiCC;
 
 LogStream my_default_log( cerr, "frog-", StampMessage ); // fall-back
 LogStream *theErrLog = &my_default_log;  // fill the externals
@@ -72,10 +71,12 @@ string testDirName;
 string tmpDirName;
 string outputFileName;
 string docid = "untitled";
+string textclass;
 bool wantOUT;
 string XMLoutFileName;
 bool doXMLin;
 bool doXMLout;
+bool doKanon;
 string outputDirName;
 string xmlDirName;
 set<string> fileNames;
@@ -83,6 +84,8 @@ string ProgName;
 int tpDebug = 0; //0 for none, more for more output
 unsigned int maxParserTokens = 0; // 0 for unlimited
 bool doTok = true;
+bool doLemma = true;
+bool doMorph = true;
 bool doMwu = true;
 bool doIOB = true;
 bool doNER = true;
@@ -90,8 +93,10 @@ bool doParse = true;
 bool doDirTest = false;
 bool doServer = false;
 bool doSentencePerLine = false;
+bool doQuoteDetection = false;
 string listenport = "void";
 string encoding;
+string uttmark = "";
 
 /* assumptions:
    each components gets its own configfile per cmdline options
@@ -121,14 +126,16 @@ void usage( ) {
   cout << "\t============= INPUT MODE (mandatory, choose one) ========================\n"
        << "\t -e <encoding>          specify encoding of the input (default UTF-8)\n"
        << "\t -t <testfile>          Run frog on this file\n"
-       << "\t -x <testfile>          Run frog on this FoLiA XML file\n"
-       << "\t -S <port>              Run as server instead of reading from testfile\n"
+       << "\t -x <testfile>          Run frog on this FoLiA XML file. Or the files form 'testdir'\n"
+       << "\t --textclass=<cls>      use the specified class to for search text in the the FoLia docs.\n"
        << "\t --testdir=<directory>  All files in this dir will be tested\n"
+       << "\t --uttmarker=<mark>     utterances are separated by 'mark' symbols"
+       << "\t                        (default none)\n"
        << "\t -n                     Assume input file to hold one sentence per line\n"
        << "\t --max-parser-tokens=<n> inhibit parsing when a sentence contains over 'n' tokens. (default: no limit)\n"
-
+       << "\t -Q                   Enable quote detection in tokeniser.\n"
        << "\t============= MODULE SELECTION ==========================================\n"
-       << "\t --skip=[mptnc]    Skip Tokenizer (t), Chunker (c), Multi-Word Units (m), Named Entity Recognition (n), or Parser (p) \n"
+       << "\t --skip=[mptncla]    Skip Tokenizer (t), Lemmatizer (l), Morphological Analyzer (a), Chunker (c), Multi-Word Units (m), Named Entity Recognition (n), or Parser (p) \n"
        << "\t============= CONFIGURATION OPTIONS =====================================\n"
        << "\t -c <filename>    Set configuration file (default " << configFileName << ")\n"
        << "\t============= OUTPUT OPTIONS ============================================\n"      
@@ -143,7 +150,11 @@ void usage( ) {
        << "\t -h. give some help.\n"
        << "\t -V or --version .   Show version info.\n"
        << "\t -d <debug level>    (for more verbosity)\n"
-       << "\t -Q                   Enable quote detection in tokeniser.\n";
+       << "\t -S <port>              Run as server instead of reading from testfile\n"
+#ifdef HAVE_OPENMP      
+       << "\t --threads=<n>       Use a maximun of 'n' threads. Default: all we can get. \n"
+#endif
+       << "\t                     (but always 1 for server mode)\n";
 }
 
 //**** stuff to process commandline options *********************************
@@ -177,7 +188,7 @@ bool parse_args( TimblOpts& Opts ) {
   };
 
   if ( configuration.fill( configFileName ) ){
-    cerr << "config read from: " << configFileName << endl;
+    *Log(theErrLog) << "config read from: " << configFileName << endl;
   }
   else {
     cerr << "failed te read configuration from! '" << configFileName << "'" << endl;
@@ -187,7 +198,7 @@ bool parse_args( TimblOpts& Opts ) {
 
   // debug opts
   if ( Opts.Find ('d', value, mood)) {
-    if ( !Timbl::stringTo<int>( value, tpDebug ) ){
+    if ( !stringTo<int>( value, tpDebug ) ){
       *Log(theErrLog) << "-d value should be an integer" << endl;
       return false;
     }
@@ -196,10 +207,17 @@ bool parse_args( TimblOpts& Opts ) {
   if ( Opts.Find ('n', value, mood)) {
     doSentencePerLine = true;
   };
+  if ( Opts.Find ('Q', value, mood)) {
+    doQuoteDetection = true;
+  };
   if ( Opts.Find( "skip", value, mood)) {
     string skip = value;
     if ( skip.find_first_of("tT") != string::npos )
       doTok = false;
+    if ( skip.find_first_of("lL") != string::npos )
+      doLemma = false;
+    if ( skip.find_first_of("aA") != string::npos )
+      doMorph = false;
     if ( skip.find_first_of("mM") != string::npos )
       doMwu = false;
     if ( skip.find_first_of("cC") != string::npos )
@@ -221,17 +239,37 @@ bool parse_args( TimblOpts& Opts ) {
       return false;
     }
     else {
-      if ( !Timbl::stringTo<unsigned int>( value, maxParserTokens ) ){
+      if ( !stringTo<unsigned int>( value, maxParserTokens ) ){
 	*Log(theErrLog) << "max-parser-tokens value should be an integer" << endl;
 	return false;
       }
     }
     Opts.Delete("max-parser-tokens");
   }
+
+  if ( Opts.Find ('S', value, mood)) {
+    doServer = true;
+    listenport= value;
+  }
+#ifdef HAVE_OPENMP      
+  if ( doServer ) {
+    // run in one thread in server mode, forking is too expensive for lots of small snippets
+    omp_set_num_threads( 1 );
+  }
+  else if ( Opts.Find( "threads", value, mood ) ){
+    int num;
+    if ( !stringTo<int>( value, num ) || num < 1 ){
+      *Log(theErrLog) << "threads value should be a positive integer" << endl;
+      return false;
+    }
+    omp_set_num_threads( num );
+  }
+#endif
+
   if ( Opts.Find( "keep-parser-files", value, mood ) ){
     if ( value.empty() ||
 	 value == "true" || value == "TRUE" || value =="yes" || value == "YES" )
-      configuration.set( "keepIntermediateFiles", "true", "parser" );
+      configuration.setatt( "keepIntermediateFiles", "true", "parser" );
     Opts.Delete("keep-parser-files");
   }
   tmpDirName = configuration.lookUp( "tmpdir", "global" );
@@ -263,12 +301,6 @@ bool parse_args( TimblOpts& Opts ) {
 	*Log(theErrLog) << "input dir " << testDirName << " not readable" << endl;
 	return false;
       }
-      getFileNames( testDirName, fileNames );
-      if ( fileNames.empty() ){
-	*Log(theErrLog) << "error: couln't find any files in directory: " 
-	     << testDirName << endl;
-	return false;
-      }
     }
     else {
       *Log(theErrLog) << "empty testdir name!" << endl;
@@ -330,7 +362,10 @@ bool parse_args( TimblOpts& Opts ) {
     XMLoutFileName = value;
     Opts.Delete('X');
   }
-  
+  if ( Opts.Find ("KANON", value, mood) ){
+    doKanon = true;
+    Opts.Delete( "KANON" );
+  }
   doXMLin = false;
   if ( Opts.Find ('x', value, mood)) {
     doXMLin = true;
@@ -350,6 +385,14 @@ bool parse_args( TimblOpts& Opts ) {
     }
     Opts.Delete('x');
   }
+  if ( Opts.Find ( "textclass", value, mood)) {
+    if ( !doXMLin ){
+      *Log(theErrLog) << "--textclass is only valid when -x is also present" << endl;
+      return false;
+    }
+    textclass = value;
+    Opts.Delete( "textclass");
+  }  
   
   if ( !outputFileName.empty() && !testDirName.empty() ){
     *Log(theErrLog) << "useless -o value" << endl;
@@ -359,16 +402,25 @@ bool parse_args( TimblOpts& Opts ) {
     *Log(theErrLog) << "useless -X value" << endl;
     return false;
   }
-
-  if ( Opts.Find ('S', value, mood)) {
-    doServer = true;
-    listenport= value;
+  
+  if ( Opts.Find ("uttmarker", value, mood)) {
+    uttmark = value;
   }
   if ( !outputDirName.empty() && testDirName.empty() ){
     *Log(theErrLog) << "useless -outputdir option" << endl;
     return false;
   }
-
+  if ( !testDirName.empty() ){
+    if ( doXMLin )
+      getFileNames( testDirName, ".xml", fileNames );
+    else
+      getFileNames( testDirName, "", fileNames );
+    if ( fileNames.empty() ){
+      *Log(theErrLog) << "error: couln't find any files in directory: " 
+		      << testDirName << endl;
+      return false;
+    }
+  }
   if ( !doServer && TestFileName.empty() && fileNames.empty() ){
     *Log(theErrLog) << "no frogging without input!" << endl;
     return false;
@@ -410,24 +462,29 @@ bool froginit(){
     bool stat = tokenizer.init( configuration, docid, !doTok );
     if ( stat ){
       tokenizer.setSentencePerLineInput( doSentencePerLine );
+      tokenizer.setQuoteDetection( doQuoteDetection );
       tokenizer.setInputEncoding( encoding );
       tokenizer.setInputXml( doXMLin );
+      tokenizer.setUttMarker( uttmark );
+      tokenizer.setTextClass( textclass );
       stat = myCGNTagger.init( configuration );
       if ( stat ){
-	if ( doIOB )
+	if ( doIOB ){
 	  stat = myIOBTagger.init( configuration );
-	if ( stat && doNER )
+	}
+	if ( stat && doNER ){
 	  stat = myNERTagger.init( configuration );
-	if ( stat ){
+	}
+	if ( stat && doLemma ){
 	  stat = myMblem.init( configuration );
-	  if ( stat ){
-	    stat = myMbma.init( configuration );
-	    if ( stat ) {
-	      if ( doMwu ){
-		stat = myMwu.init( configuration );
-		if ( stat && doParse ){
-		  stat = myParser.init( configuration );
-		}
+	}
+	if ( stat && doMorph ){
+	  stat = myMbma.init( configuration );
+	  if ( stat ) {
+	    if ( doMwu ){
+	      stat = myMwu.init( configuration );
+	      if ( stat && doParse ){
+		stat = myParser.init( configuration );
 	      }
 	    }
 	  }
@@ -455,17 +512,24 @@ bool froginit(){
 	tokStat = tokenizer.init( configuration, docid, !doTok );
 	if ( tokStat ){
 	  tokenizer.setSentencePerLineInput( doSentencePerLine );
+	  tokenizer.setQuoteDetection( doQuoteDetection );
 	  tokenizer.setInputEncoding( encoding );
 	  tokenizer.setInputXml( doXMLin );
+	  tokenizer.setUttMarker( uttmark );
+	  tokenizer.setTextClass( textclass );
 	}
       }
 #pragma omp section
       {
-	lemStat = myMblem.init( configuration );
+	if ( doLemma ){
+	  lemStat = myMblem.init( configuration );
+	}
       }
 #pragma omp section
       {
-	mbaStat = myMbma.init( configuration );
+	if ( doMorph ){
+	  mbaStat = myMbma.init( configuration );
+	}
       }
 #pragma omp section 
       {
@@ -473,20 +537,22 @@ bool froginit(){
       }
 #pragma omp section 
       {
-	if ( doIOB )
+	if ( doIOB ){
 	  iobStat = myIOBTagger.init( configuration );
+	}
       }
 #pragma omp section 
       {
-	if ( doNER )
+	if ( doNER ){
 	  nerStat = myNERTagger.init( configuration );
+	}
       }
 #pragma omp section
       {
 	if ( doMwu ){
 	  mwuStat = myMwu.init( configuration );
 	  if ( mwuStat && doParse ){
-	    Common::Timer initTimer;
+	    Timer initTimer;
 	    initTimer.start();
 	    parStat = myParser.init( configuration );
 	    initTimer.stop();
@@ -547,16 +613,23 @@ vector<Word*> lookup( Word *word, const vector<Entity*>& entities ){
 
 Dependency *lookupDep( const Word *word, 
 		       const vector<Dependency*>&dependencies ){
-  //  cerr << "\nlookup "<< word << " in " << dependencies << endl;
+  if ( tpDebug ){
+    using TiCC::operator<<;
+    *Log( theErrLog ) << "lookup "<< word << " in " << dependencies << endl;
+  }
   for ( size_t i=0; i < dependencies.size(); ++i ){
-    //    cerr << "\nprobeer " << dependencies[i] << endl;
+    if ( tpDebug ){
+      *Log( theErrLog ) << "probeer " << dependencies[i] << endl;
+    }
     try {
       vector<DependencyDependent*> dv = dependencies[i]->select<DependencyDependent>();
       if ( !dv.empty() ){
 	vector<Word*> v = dv[0]->select<Word>();
 	for ( size_t j=0; j < v.size(); ++j ){
 	  if ( v[j] == word ){
-	    //	    cerr << "\nfound word " << v[j] << endl;
+	    if ( tpDebug ){
+	      *Log(theErrLog) << "\nfound word " << v[j] << endl;
+	    }
 	    return dependencies[i];
 	  }
 	}
@@ -576,7 +649,7 @@ string lookupNEREntity( const vector<Word *>& mwu,
   string endresult;
   for ( size_t j=0; j < mwu.size(); ++j ){
     if ( tpDebug ){
-      using folia::operator<<;
+      using TiCC::operator<<;
       *Log(theErrLog) << "lookup "<< mwu[j] << " in " << entities << endl;
     }
     string result;
@@ -624,7 +697,7 @@ string lookupIOBChunk( const vector<Word *>& mwu,
   string endresult;
   for ( size_t j=0; j < mwu.size(); ++j ){
     if ( tpDebug ){
-      using folia::operator<<;
+      using TiCC::operator<<;
       *Log(theErrLog) << "lookup "<< mwu[j] << " in " << chunks << endl;
     }
     string result;
@@ -677,7 +750,7 @@ void displayMWU( ostream& os, size_t index,
     Word *word = mwu[p];
     try { 
       wrd += word->str();
-      PosAnnotation *postag = word->annotation<PosAnnotation>();
+      PosAnnotation *postag = word->annotation<PosAnnotation>( );
       pos += postag->cls();
       if ( p < mwu.size() -1 ){
 	wrd += "_";
@@ -729,12 +802,24 @@ ostream &showResults( ostream& os,
 		      bool showParse ){
   vector<Word*> words = sentence->words();
   vector<Entity*> mwu_entities = sentence->select<Entity>( myMwu.getTagset() );
-  // using folia::operator<<;
-  // *Log(theErrLog) << "mwu entities " << mwu_entities << endl;
   vector<Dependency*> dependencies = sentence->select<Dependency>();
   vector<Chunk*> iob_chunking = sentence->select<Chunk>();
   vector<Entity*> ner_entities = sentence->select<Entity>( myNERTagger.getTagset() );
-  //  *Log(theErrLog) << "ner entities " << ner_entities << endl;
+  static set<ElementType> excludeSet;
+  vector<Sentence*> parts = sentence->select<Sentence>( excludeSet );
+  if ( !doQuoteDetection )
+    assert( parts.size() == 0 );
+  for ( size_t i=0; i < parts.size(); ++i ){
+    vector<Entity*> ents = parts[i]->select<Entity>( myMwu.getTagset() );
+    mwu_entities.insert( mwu_entities.end(), ents.begin(), ents.end() );
+    vector<Dependency*> deps = parts[i]->select<Dependency>();
+    dependencies.insert( dependencies.end(), deps.begin(), deps.end() );
+    vector<Chunk*> chunks = parts[i]->select<Chunk>();
+    iob_chunking.insert( iob_chunking.end(), chunks.begin(), chunks.end() );
+    vector<Entity*> ners = parts[i]->select<Entity>( myNERTagger.getTagset() );
+    ner_entities.insert( ner_entities.end(), ners.begin(), ners.end() );
+  }
+
   size_t index = 1;
   map<FoliaElement*, int> enumeration;
   vector<vector<Word*> > mwus;
@@ -770,8 +855,17 @@ ostream &showResults( ostream& os,
       string cls;
       Dependency *dep = lookupDep( mwus[i][0], dependencies );
       if ( dep ){
-	vector<DependencyHead*> w = dep->select<DependencyHead>();
-	os << "\t" << enumeration.find(w[0]->index(0))->second << "\t" << dep->cls();
+	vector<Headwords*> w = dep->select<Headwords>();
+	size_t num;
+	if ( w[0]->index(0)->isinstance( PlaceHolder_t ) ){
+	  string indexS = w[0]->index(0)->str();
+	  FoliaElement *pnt = w[0]->index(0)->doc()->index(indexS);
+	  num = enumeration.find(pnt->index(0))->second;
+	}
+	else {
+	  num = enumeration.find(w[0]->index(0))->second;
+	}
+	os << "\t" << num << "\t" << dep->cls();
       }
       else {
 	os << "\t"<< 0 << "\tROOT";
@@ -788,12 +882,14 @@ ostream &showResults( ostream& os,
   return os;
 }
 
-void TestSentence( const vector<Sentence*>& sentences,
-		   size_t index,
+bool TestSentence( Sentence* sent,
 		   ostream& outStream,
 		   TimerBlock& timers ){
-  Sentence *sent = sentences[index];
-  vector<Word*> swords = sent->words();
+  vector<Word*> swords;
+  if ( doQuoteDetection )
+    swords = sent->wordParts();
+  else
+    swords = sent->words();
   bool showParse = doParse;
   if ( !swords.empty() ) {
 #pragma omp parallel sections
@@ -801,14 +897,14 @@ void TestSentence( const vector<Sentence*>& sentences,
 #pragma omp section
       {
 	timers.tagTimer.start();
-	myCGNTagger.Classify( sent );
+	myCGNTagger.Classify( swords );
 	timers.tagTimer.stop();
       }
 #pragma omp section
       {
 	if ( doIOB ){
 	  timers.iobTimer.start();
-	  myIOBTagger.Classify( sent );
+	  myIOBTagger.Classify( swords );
 	  timers.iobTimer.stop();
 	}
       }
@@ -816,60 +912,54 @@ void TestSentence( const vector<Sentence*>& sentences,
       {
 	if ( doNER ){
 	  timers.nerTimer.start();
-	  myNERTagger.Classify( sent );
+	  myNERTagger.Classify( swords );
 	  timers.nerTimer.stop();
 	}
       }
     } // parallel sections
     for ( size_t i = 0; i < swords.size(); ++i ) {
-      string mbmaLemma;
-      string mblemLemma;
 #pragma omp parallel sections
       {
 #pragma omp section
 	{
-	  timers.mbmaTimer.start();
-	  if (tpDebug) 
-	    *Log(theErrLog) << "Calling mbma..." << endl;
-	  mbmaLemma = myMbma.Classify( swords[i] );
-	  timers.mbmaTimer.stop();
+	  if ( doMorph ){
+	    timers.mbmaTimer.start();
+	    if (tpDebug) 
+	      *Log(theErrLog) << "Calling mbma..." << endl;
+	    myMbma.Classify( swords[i] );
+	    timers.mbmaTimer.stop();
+	  }
 	}
 #pragma omp section
 	{
-	  timers.mblemTimer.start();
-	  if (tpDebug) 
-	    *Log(theErrLog) << "Calling mblem..." << endl;
-	  mblemLemma = myMblem.Classify( swords[i] );
-	  timers.mblemTimer.stop();
+	  if ( doLemma ){
+	    timers.mblemTimer.start();
+	    if (tpDebug) 
+	      *Log(theErrLog) << "Calling mblem..." << endl;
+	    myMblem.Classify( swords[i] );
+	    timers.mblemTimer.stop();
+	  }
 	}
       } // omp parallel sections
-      if (tpDebug) {
-	*Log(theErrLog) << "tagged word[" << i <<"]: " << swords[i]->str() 
-			<< " tag " << swords[i]->pos() << endl;
-	*Log(theErrLog) << "analysis: " << mblemLemma << " " << mbmaLemma << endl;
-      }
     } //for int i = 0 to num_words
     
     if ( doMwu ){
       if ( swords.size() > 0 ){
 	timers.mwuTimer.start();
-	myMwu.Classify( sent );
+	myMwu.Classify( swords );
 	timers.mwuTimer.stop();
       }
     }
     if ( doParse ){
       if ( maxParserTokens != 0 && swords.size() > maxParserTokens ){
-	*Log(theErrLog) << "WARNING!" << endl;
-	*Log(theErrLog) << "Sentence " << index+1 << " isn't parsed because it contains " << swords.size() << " tokens, and you provided the --max-parser-tokens=" << maxParserTokens << " option." << endl;
 	showParse = false;
       }
       else {
-	myParser.Parse( sent, myMwu.getTagset(), tmpDirName, timers );
+	myParser.Parse( swords, myMwu.getTagset(), tmpDirName, timers );
       }
     }
   }
-  if ( !(doServer && doXMLout) )
-    showResults( outStream, sent, showParse );
+  return showParse;
 }
 
 void Test( Document& doc,
@@ -880,8 +970,10 @@ void Test( Document& doc,
   // first we make sure that the doc will accept our annotations, by
   // declaring them in the doc
   myCGNTagger.addDeclaration( doc );
-  myMblem.addDeclaration( doc );
-  myMbma.addDeclaration( doc );
+  if ( doLemma )
+    myMblem.addDeclaration( doc );
+  if ( doMorph )
+    myMbma.addDeclaration( doc );
   if (doIOB)
     myIOBTagger.addDeclaration( doc );
   if (doNER)
@@ -890,22 +982,37 @@ void Test( Document& doc,
     myMwu.addDeclaration( doc );
   if (doParse) 
     myParser.addDeclaration( doc );
+
   if ( tpDebug > 5 )
     *Log(theErrLog) << "Testing document :" << doc << endl;
-  vector<Sentence*> sentences = doc.sentences();
+  
+  vector<Sentence*> topsentences = doc.sentences();
+  vector<Sentence*> sentences;
+  if ( doQuoteDetection )
+    sentences = doc.sentenceParts();
+  else
+    sentences = topsentences;
   size_t numS = sentences.size();
   if ( numS > 0 ) { //process sentences 
     if  (tpDebug > 0) 
       *Log(theErrLog) << "found " << numS << " sentence(s) in document." << endl;
     for ( size_t i = 0; i < numS; i++) {
       /* ******* Begin process sentence  ********** */
-      TestSentence( sentences, i, outStream, timers ); 
       //NOTE- full sentences are passed (which may span multiple lines) (MvG)
+      bool showParse = TestSentence( sentences[i], outStream, timers ); 
+      if ( doParse && !showParse ){
+	*Log(theErrLog) << "WARNING!" << endl;
+	*Log(theErrLog) << "Sentence " << i+1 << " isn't parsed because it contains more tokens then set with the --max-parser-tokens=" << maxParserTokens << " option." << endl;
+      }
+    }
+    for ( size_t i = 0; i < topsentences.size(); ++i ) {
+      if ( !(doServer && doXMLout) )
+	showResults( outStream, topsentences[i], doParse );
     }
     if ( doServer && doXMLout )
       outStream << doc << endl;
     if ( !xmlOutFile.empty() ){
-      doc.save( xmlOutFile );
+      doc.save( xmlOutFile, doKanon );
       *Log(theErrLog) << "resulting FoLiA doc saved in " << xmlOutFile << endl;
     }
   } 
@@ -922,8 +1029,10 @@ void Test( Document& doc,
     *Log(theErrLog) << "IOB chunking took:  " << timers.iobTimer << endl;
   if ( doNER)
     *Log(theErrLog) << "NER took:           " << timers.nerTimer << endl;
-  *Log(theErrLog) << "MBA took:           " << timers.mbmaTimer << endl;
-  *Log(theErrLog) << "Mblem took:         " << timers.mblemTimer << endl;
+  if ( doMorph )
+    *Log(theErrLog) << "MBA took:           " << timers.mbmaTimer << endl;
+  if ( doLemma )
+    *Log(theErrLog) << "Mblem took:         " << timers.mblemTimer << endl;
   if ( doMwu )
     *Log(theErrLog) << "MWU resolving took: " << timers.mwuTimer << endl;
   if ( doParse ){
@@ -954,9 +1063,19 @@ void Test( const string& infilename,
       exit( EXIT_FAILURE );
     }
   }
+  *Log(theErrLog) << "Frogging " << infilename << endl;
   if ( doXMLin ){
     Document doc;
-    doc.readFromFile( infilename );
+    try {
+      doc.readFromFile( infilename );
+    }
+    catch ( exception &e ){
+      *Log(theErrLog) << "retrieving FoLiA from '" << infilename << "' failed" << endl;
+      if ( !outName.empty() ){
+	delete os;
+      }
+      return;
+    }
     tokenizer.tokenize( doc );
     Test( doc, *os, xmlOutFile );
   }
@@ -1006,9 +1125,19 @@ void TestServer( Sockets::ServerSocket &conn) {
 	Test( doc, outputstream );
       }
       else {
-	string data = "";      
-	if ( !conn.read( data ) )	 //read data from client
-	  throw( runtime_error( "read failed" ) );
+	string data = "";
+	if ( doSentencePerLine ){
+	  if ( !conn.read( data ) )	 //read data from client
+	    throw( runtime_error( "read failed" ) );
+	}
+	else {
+	  string line;
+	  while( conn.read(line) ){
+	    if ( line == "EOT" )
+	      break;
+	    data += line + "\n";
+	  }
+	}
 	if (tpDebug)
 	  *Log(theErrLog) << "Received: [" << data << "]" << endl;
 	*Log(theErrLog) << "Processing... " << endl;
@@ -1033,8 +1162,7 @@ void TestServer( Sockets::ServerSocket &conn) {
 
 
 int main(int argc, char *argv[]) {
-  std::ios_base::sync_with_stdio(false);
-  cerr << "frog " << VERSION << " (c) ILK 1998 - 2012" << endl;
+  cerr << "frog " << VERSION << " (c) ILK 1998 - 2013" << endl;
   cerr << "Induction of Linguistic Knowledge Research Group, Tilburg University" << endl;
   ProgName = argv[0];
   cerr << "based on [" << Tokenizer::VersionName() << ", "
@@ -1042,19 +1170,14 @@ int main(int argc, char *argv[]) {
        << Timbl::VersionName() << ", "
        << TimblServer::VersionName() << ", "
        << Tagger::VersionName() << "]" << endl;
-  cout << "configdir: " << configDir << endl;
+  //  cout << "configdir: " << configDir << endl;
+  std::ios_base::sync_with_stdio(false);
   try {
     TimblOpts Opts(argc, argv);
         
     if ( parse_args(Opts) ){
       if (  !froginit() ){
-	cerr << "terminated." << endl;
-	return EXIT_FAILURE;
-      }
-      
-      if ( doServer ) {
-      	// run in one thread in server mode, forking is too expensive for lots of small snippets
-      	omp_set_num_threads( 1 );
+	throw runtime_error( "init failed" );
       }
       if ( !fileNames.empty() ) {
 	string outPath;
@@ -1118,7 +1241,7 @@ int main(int argc, char *argv[]) {
 		int pid = fork();				
 		if (pid < 0) {
 		  *Log(theErrLog) << "ERROR on fork" << endl;
-		  exit(EXIT_FAILURE);
+		  throw runtime_error( "FORK failed" );
 		} else if (pid == 0)  {
 		  //		  server = NULL;
 		  TestServer(conn );
@@ -1132,7 +1255,7 @@ int main(int argc, char *argv[]) {
 	  } catch ( std::exception& e )
 	  {
 	    *Log(theErrLog) << "Server error:" << e.what() << " Exiting." << endl;
-	    exit(EXIT_FAILURE);
+	    throw;
 	  }
 	
       } else {
@@ -1144,14 +1267,12 @@ int main(int argc, char *argv[]) {
       }
     }
     else {
-      return EXIT_FAILURE;
+      throw runtime_error( "invalid arguments" );
     }
   }
   catch ( const exception& e ){
     *Log(theErrLog) << "fatal error: " << e.what() << endl;
     return EXIT_FAILURE;
   }
-  //  delete tagger;
-  
   return EXIT_SUCCESS;
 }
diff --git a/src/Makefile.am b/src/Makefile.am
index a4585d9..ef334ee 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,19 +1,26 @@
-# $Id: Makefile.am 14267 2012-02-15 13:05:47Z sloot $
+# $Id: Makefile.am 15926 2013-04-03 16:00:02Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Makefile.am $
 
 AM_CPPFLAGS = -I at top_srcdir@/include
+AM_CXXFLAGS = -DSYSCONF_PATH=\"$(SYSCONFDIR)\" -DPYTHONDIR=\"$(PYTHONDIR)\"
+bin_PROGRAMS = frog mbma mblem
 
-bin_SCRIPTS = frog-dp-update
-bin_PROGRAMS = frog
+frog_SOURCES = Frog.cxx
+mbma_SOURCES = mbma_prog.cxx
+mblem_SOURCES = mblem_prog.cxx
 
-frog_SOURCES = mbma_mod.cxx mblem_mod.cxx mwu_chunker_mod.cxx \
-	Frog.cxx Frog-util.cxx Parser.cxx \
+LDADD = libfrog.la
+lib_LTLIBRARIES = libfrog.la
+libfrog_la_LDFLAGS = -version-info 1:0:0
+
+libfrog_la_SOURCES = mbma_mod.cxx mblem_mod.cxx \
+	Frog-util.cxx mwu_chunker_mod.cxx Parser.cxx \
 	cgn_tagger_mod.cxx iob_tagger_mod.cxx ner_tagger_mod.cxx \
-	Configuration.cxx ucto_tokenizer_mod.cxx
+	ucto_tokenizer_mod.cxx
 
 
 TESTS_ENVIRONMENT = $(SHELL) -x
 TESTS = tst.sh
 
-EXTRA_DIST = tst.sh frog-dp-update
+EXTRA_DIST = tst.sh
 CLEANFILES = tst.out
diff --git a/src/Makefile.in b/src/Makefile.in
index f989568..8288152 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,7 @@
 
 @SET_MAKE@
 
-# $Id: Makefile.am 14267 2012-02-15 13:05:47Z sloot $
+# $Id: Makefile.am 15926 2013-04-03 16:00:02Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Makefile.am $
 
 
@@ -38,14 +38,13 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-bin_PROGRAMS = frog$(EXEEXT)
+bin_PROGRAMS = frog$(EXEEXT) mbma$(EXEEXT) mblem$(EXEEXT)
 subdir = src
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -56,15 +55,6 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_frog_OBJECTS = mbma_mod.$(OBJEXT) mblem_mod.$(OBJEXT) \
-	mwu_chunker_mod.$(OBJEXT) Frog.$(OBJEXT) Frog-util.$(OBJEXT) \
-	Parser.$(OBJEXT) cgn_tagger_mod.$(OBJEXT) \
-	iob_tagger_mod.$(OBJEXT) ner_tagger_mod.$(OBJEXT) \
-	Configuration.$(OBJEXT) ucto_tokenizer_mod.$(OBJEXT)
-frog_OBJECTS = $(am_frog_OBJECTS)
-frog_LDADD = $(LDADD)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -86,7 +76,35 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-SCRIPTS = $(bin_SCRIPTS)
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libfrog_la_LIBADD =
+am_libfrog_la_OBJECTS = mbma_mod.lo mblem_mod.lo Frog-util.lo \
+	mwu_chunker_mod.lo Parser.lo cgn_tagger_mod.lo \
+	iob_tagger_mod.lo ner_tagger_mod.lo ucto_tokenizer_mod.lo
+libfrog_la_OBJECTS = $(am_libfrog_la_OBJECTS)
+libfrog_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libfrog_la_LDFLAGS) $(LDFLAGS) -o $@
+PROGRAMS = $(bin_PROGRAMS)
+am_frog_OBJECTS = Frog.$(OBJEXT)
+frog_OBJECTS = $(am_frog_OBJECTS)
+frog_LDADD = $(LDADD)
+frog_DEPENDENCIES = libfrog.la
+am_mblem_OBJECTS = mblem_prog.$(OBJEXT)
+mblem_OBJECTS = $(am_mblem_OBJECTS)
+mblem_LDADD = $(LDADD)
+mblem_DEPENDENCIES = libfrog.la
+am_mbma_OBJECTS = mbma_prog.$(OBJEXT)
+mbma_OBJECTS = $(am_mbma_OBJECTS)
+mbma_LDADD = $(LDADD)
+mbma_DEPENDENCIES = libfrog.la
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
@@ -100,8 +118,10 @@ CXXLD = $(CXX)
 CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
-SOURCES = $(frog_SOURCES)
-DIST_SOURCES = $(frog_SOURCES)
+SOURCES = $(libfrog_la_SOURCES) $(frog_SOURCES) $(mblem_SOURCES) \
+	$(mbma_SOURCES)
+DIST_SOURCES = $(libfrog_la_SOURCES) $(frog_SOURCES) $(mblem_SOURCES) \
+	$(mbma_SOURCES)
 ETAGS = etags
 CTAGS = ctags
 am__tty_colors = \
@@ -197,7 +217,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -207,12 +227,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -259,6 +279,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -269,15 +291,21 @@ top_srcdir = @top_srcdir@
 ucto_CFLAGS = @ucto_CFLAGS@
 ucto_LIBS = @ucto_LIBS@
 AM_CPPFLAGS = -I at top_srcdir@/include
-bin_SCRIPTS = frog-dp-update
-frog_SOURCES = mbma_mod.cxx mblem_mod.cxx mwu_chunker_mod.cxx \
-	Frog.cxx Frog-util.cxx Parser.cxx \
+AM_CXXFLAGS = -DSYSCONF_PATH=\"$(SYSCONFDIR)\" -DPYTHONDIR=\"$(PYTHONDIR)\"
+frog_SOURCES = Frog.cxx
+mbma_SOURCES = mbma_prog.cxx
+mblem_SOURCES = mblem_prog.cxx
+LDADD = libfrog.la
+lib_LTLIBRARIES = libfrog.la
+libfrog_la_LDFLAGS = -version-info 1:0:0
+libfrog_la_SOURCES = mbma_mod.cxx mblem_mod.cxx \
+	Frog-util.cxx mwu_chunker_mod.cxx Parser.cxx \
 	cgn_tagger_mod.cxx iob_tagger_mod.cxx ner_tagger_mod.cxx \
-	Configuration.cxx ucto_tokenizer_mod.cxx
+	ucto_tokenizer_mod.cxx
 
 TESTS_ENVIRONMENT = $(SHELL) -x
 TESTS = tst.sh
-EXTRA_DIST = tst.sh frog-dp-update
+EXTRA_DIST = tst.sh
 CLEANFILES = tst.out
 all: all-am
 
@@ -313,6 +341,39 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libfrog.la: $(libfrog_la_OBJECTS) $(libfrog_la_DEPENDENCIES) $(EXTRA_libfrog_la_DEPENDENCIES) 
+	$(libfrog_la_LINK) -rpath $(libdir) $(libfrog_la_OBJECTS) $(libfrog_la_LIBADD) $(LIBS)
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
 	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@@ -356,43 +417,15 @@ clean-binPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-frog$(EXEEXT): $(frog_OBJECTS) $(frog_DEPENDENCIES) 
+frog$(EXEEXT): $(frog_OBJECTS) $(frog_DEPENDENCIES) $(EXTRA_frog_DEPENDENCIES) 
 	@rm -f frog$(EXEEXT)
 	$(CXXLINK) $(frog_OBJECTS) $(frog_LDADD) $(LIBS)
-install-binSCRIPTS: $(bin_SCRIPTS)
-	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n' \
-	    -e 'h;s|.*|.|' \
-	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
-	      if (++n[d] == $(am__install_max)) { \
-		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
-	    else { print "f", d "/" $$4, $$1 } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	     test -z "$$files" || { \
-	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	     } \
-	; done
-
-uninstall-binSCRIPTS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	       sed -e 's,.*/,,;$(transform)'`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+mblem$(EXEEXT): $(mblem_OBJECTS) $(mblem_DEPENDENCIES) $(EXTRA_mblem_DEPENDENCIES) 
+	@rm -f mblem$(EXEEXT)
+	$(CXXLINK) $(mblem_OBJECTS) $(mblem_LDADD) $(LIBS)
+mbma$(EXEEXT): $(mbma_OBJECTS) $(mbma_DEPENDENCIES) $(EXTRA_mbma_DEPENDENCIES) 
+	@rm -f mbma$(EXEEXT)
+	$(CXXLINK) $(mbma_OBJECTS) $(mbma_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -400,17 +433,18 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Configuration.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Frog-util.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Frog-util.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Frog.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Parser.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cgn_tagger_mod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/iob_tagger_mod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mblem_mod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbma_mod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mwu_chunker_mod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ner_tagger_mod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ucto_tokenizer_mod.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Parser.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cgn_tagger_mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/iob_tagger_mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mblem_mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mblem_prog.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbma_mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbma_prog.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mwu_chunker_mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ner_tagger_mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ucto_tokenizer_mod.Plo at am__quote@
 
 .cxx.o:
 @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -572,14 +606,15 @@ check-TESTS: $(TESTS)
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
 	  if test "$$failed" -eq 0; then \
-	    echo "$$grn$$dashes"; \
+	    col="$$grn"; \
 	  else \
-	    echo "$$red$$dashes"; \
+	    col="$$red"; \
 	  fi; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes$$std"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -616,9 +651,11 @@ distdir: $(DISTFILES)
 check-am: all-am
 	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
+install-binPROGRAMS: install-libLTLIBRARIES
+
 installdirs:
-	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -631,10 +668,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -649,7 +691,8 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+	clean-libtool mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -675,7 +718,7 @@ install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-binPROGRAMS install-binSCRIPTS
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
 
 install-html: install-html-am
 
@@ -715,24 +758,25 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
+uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES
 
 .MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-binPROGRAMS install-binSCRIPTS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
+	clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+	clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags uninstall uninstall-am uninstall-binPROGRAMS \
-	uninstall-binSCRIPTS
+	uninstall-libLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/Parser.cxx b/src/Parser.cxx
index 3f7fa22..36e75af 100644
--- a/src/Parser.cxx
+++ b/src/Parser.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: Parser.cxx 14481 2012-03-21 11:26:55Z sloot $
+  $Id: Parser.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Parser.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -39,13 +39,12 @@
 
 #include "config.h"
 #include "timbl/TimblAPI.h"
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
 #include "frog/Frog.h"
-#include "frog/Configuration.h"
+#include "ticcutils/Configuration.h"
 #include "frog/Parser.h"
 
 using namespace std;
+using namespace TiCC;
 using namespace folia;
 
 PythonInterface::PythonInterface( ) {
@@ -116,11 +115,11 @@ void PythonInterface::parse( const string& depFile,
 					  inputFile.c_str() );
 }
 
-Common::Timer prepareTimer;
-Common::Timer relsTimer;
-Common::Timer pairsTimer;
-Common::Timer dirTimer;
-Common::Timer csiTimer;
+TiCC::Timer prepareTimer;
+TiCC::Timer relsTimer;
+TiCC::Timer pairsTimer;
+TiCC::Timer dirTimer;
+TiCC::Timer csiTimer;
 
 struct parseData {
   void clear() { words.clear(); heads.clear(); mods.clear(); mwus.clear(); }
@@ -189,9 +188,17 @@ bool Parser::init( const Configuration& configuration ){
   }
   else
     tagset = val;
+
+  val = configuration.lookUp( "set", "tagger" );
+  if ( val.empty() ){
+    cgn_tagset = "http://ilk.uvt.nl/folia/sets/frog-mbpos-cgn";
+  }
+  else
+    cgn_tagset = val;
+
   val = configuration.lookUp( "maxDepSpan", "parser" );
   if ( !val.empty() ){
-    size_t gs = stringTo<size_t>( val );
+    size_t gs = TiCC::stringTo<size_t>( val );
     if ( gs < 50 ){
       maxDepSpanS = val;
       maxDepSpan = gs;
@@ -767,21 +774,22 @@ void Parser::addDeclaration( Document& doc ) const {
 	       + "', annotatortype='auto'");
 }
 
-void Parser::prepareParse( Sentence *sent, const string& setname,
+void Parser::prepareParse( const vector<Word *>& fwords,
+			   const string& setname,
 			   parseData& pd ) {
   pd.clear();
-  vector<Word*> fwords = sent->words();
+  Sentence *sent = fwords[0]->sentence();
   vector<Entity*> entities = sent->select<Entity>(setname);
   for( size_t i=0; i < fwords.size(); ++i ){
     Word *word = fwords[i];
     vector<Word*> mwu = lookup( word, entities );
     if ( !mwu.empty() ){
-      string word;
+      string multi_word;
       string head;
       string mod;
       for ( size_t p=0; p < mwu.size(); ++p ){
-	word += mwu[p]->str();
-	PosAnnotation *postag = mwu[p]->annotation<PosAnnotation>();
+	multi_word += mwu[p]->str();
+	PosAnnotation *postag = mwu[p]->annotation<PosAnnotation>( cgn_tagset );
 	head += postag->feat("head");
 	vector<folia::Feature*> feats = postag->select<folia::Feature>();
 	for ( size_t j=0; j < feats.size(); ++j ){
@@ -790,12 +798,12 @@ void Parser::prepareParse( Sentence *sent, const string& setname,
 	    mod += "|";
 	}
 	if ( p < mwu.size() -1 ){
-	  word += "_";
+	  multi_word += "_";
 	  head += "_";
 	  mod += "_";
 	}
       }
-      pd.words.push_back( word );
+      pd.words.push_back( multi_word );
       pd.heads.push_back( head );
       pd.mods.push_back( mod );
       pd.mwus.push_back( mwu );
@@ -803,7 +811,7 @@ void Parser::prepareParse( Sentence *sent, const string& setname,
     }
     else {
       pd.words.push_back( word->str() );
-      PosAnnotation *postag = word->annotation<PosAnnotation>();
+      PosAnnotation *postag = word->annotation<PosAnnotation>( cgn_tagset );
       string head = postag->feat("head");
       pd.heads.push_back( head );
       string mod;
@@ -839,57 +847,59 @@ void Parser::prepareParse( Sentence *sent, const string& setname,
   }
 }
 
- void appendParseResult( Sentence *sent, 
-			 parseData& pd,
-			 istream& is ){
-   string line;
-   int cnt=0;
-   vector<int> nums;
-   vector<string> roles;
-   while ( getline( is, line ) ){
-     vector<string> parts;
-     int num = Timbl::split_at( line, parts, " " );
-     if ( num > 7 ){
-       if ( Timbl::stringTo<int>( parts[0] ) != cnt+1 ){
-	 *Log(theErrLog) << "confused! " << endl;
-	 *Log(theErrLog) << "got line '" << line << "'" << endl;
-       }
-       nums.push_back( Timbl::stringTo<int>(parts[6]) );
-       roles.push_back( parts[7] );
-     }
-     ++cnt;
-   }
-   DependenciesLayer *dl = new DependenciesLayer();
+void appendParseResult( const vector<Word *>& words,
+			parseData& pd,
+			istream& is ){
+  string line;
+  int cnt=0;
+  vector<int> nums;
+  vector<string> roles;
+  while ( getline( is, line ) ){
+    vector<string> parts;
+    int num = TiCC::split_at( line, parts, " " );
+    if ( num > 7 ){
+      if ( TiCC::stringTo<int>( parts[0] ) != cnt+1 ){
+	*Log(theErrLog) << "confused! " << endl;
+	*Log(theErrLog) << "got line '" << line << "'" << endl;
+      }
+      nums.push_back( TiCC::stringTo<int>(parts[6]) );
+      roles.push_back( parts[7] );
+    }
+    ++cnt;
+  }
+  DependenciesLayer *dl = new DependenciesLayer();
+  Sentence *sent;
 #pragma omp critical(foliaupdate)
-   {
-     sent->append( dl );
-   }
-   for ( size_t i=0; i < nums.size(); ++i ){
-     if ( nums[i] != 0 ){
-       KWargs args;
-       args["generate-id"] = sent->id();
-       args["class"] = roles[i];
+  {
+    sent = words[0]->sentence();
+    sent->append( dl );
+  }
+  for ( size_t i=0; i < nums.size(); ++i ){
+    if ( nums[i] != 0 ){
+      KWargs args;
+      args["generate-id"] = sent->id();
+      args["class"] = roles[i];
 #pragma omp critical(foliaupdate)
-       {
-	 Dependency *d = new Dependency( sent->doc(), args );
-	 dl->append( d );
-	 DependencyHead *dh = new DependencyHead();
-	 for ( size_t j=0; j < pd.mwus[nums[i]-1].size(); ++ j ){
-	   dh->append( pd.mwus[nums[i]-1][j] );
-	 }
-	 d->append( dh );
-	 DependencyDependent *dd = new DependencyDependent();
-	 for ( size_t j=0; j < pd.mwus[i].size(); ++ j ){
-	   dd->append( pd.mwus[i][j] );
-	 }
-	 d->append( dd );
-       }
-     }
-   }
- }
- 
- 
-void Parser::Parse( Sentence *sent, const string& mwuSet,
+      {
+	Dependency *d = new Dependency( sent->doc(), args );
+	dl->append( d );
+	Headwords *dh = new Headwords();
+	for ( size_t j=0; j < pd.mwus[nums[i]-1].size(); ++ j ){
+	  dh->append( pd.mwus[nums[i]-1][j] );
+	}
+	d->append( dh );
+	DependencyDependent *dd = new DependencyDependent();
+	for ( size_t j=0; j < pd.mwus[i].size(); ++ j ){
+	  dd->append( pd.mwus[i][j] );
+	}
+	d->append( dd );
+      }
+    }
+  }
+}
+
+
+void Parser::Parse( const vector<Word*>& words, const string& mwuSet,
 		    const string& tmpDirName, TimerBlock& timers ){
   pid_t pid = getpid();
   string pids = toString( pid );
@@ -899,7 +909,7 @@ void Parser::Parse( Sentence *sent, const string& mwuSet,
     *Log(parseLog) << "Parser is not initialized!" << endl;
     exit(1);
   }
-  if ( !sent ){
+  if ( words.empty() ){
     *Log(parseLog) << "unable to parse an analisis without words" << endl;
     return;
   }
@@ -913,7 +923,7 @@ void Parser::Parse( Sentence *sent, const string& mwuSet,
   remove( resFileName.c_str() );
   timers.prepareTimer.start();
   parseData pd;  
-  prepareParse( sent, mwuSet, pd );
+  prepareParse( words, mwuSet, pd );
   timers.prepareTimer.stop();
 #pragma omp parallel sections
   {
@@ -956,7 +966,7 @@ void Parser::Parse( Sentence *sent, const string& mwuSet,
   timers.csiTimer.stop();
   ifstream resFile( resFileName.c_str() );
   if ( resFile ){
-    appendParseResult( sent, pd, resFile );
+    appendParseResult( words, pd, resFile );
   }
   else
     *Log(parseLog) << "couldn't open results file: " << resFileName << endl;
diff --git a/src/cgn_tagger_mod.cxx b/src/cgn_tagger_mod.cxx
index 1ecb787..8a1334a 100644
--- a/src/cgn_tagger_mod.cxx
+++ b/src/cgn_tagger_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: cgn_tagger_mod.cxx 14489 2012-03-22 11:37:02Z sloot $
+  $Id: cgn_tagger_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/cgn_tagger_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -29,8 +29,6 @@
 */
 
 #include "mbt/MbtAPI.h"
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
 #include "frog/Frog.h"
 #include "frog/cgn_tagger_mod.h"
 
@@ -180,7 +178,7 @@ bool CGNTagger::init( const Configuration& conf ){
   debug = tpDebug;
   string db = conf.lookUp( "debug", "tagger" );
   if ( !db.empty() )
-    debug = folia::stringTo<int>( db );
+    debug = TiCC::stringTo<int>( db );
   switch ( debug ){
   case 0:
   case 1:
@@ -207,7 +205,12 @@ bool CGNTagger::init( const Configuration& conf ){
     *Log(cgnLog) << "Unable to find settings for Tagger" << endl;
     return false;
   }
-  string settings =  val;
+  string settings;
+  if ( val[0] == '/' ) // an absolute path
+    settings = val;
+  else
+    settings =  configuration.configDir() + val;
+
   val = conf.lookUp( "version", "tagger" );
   if ( val.empty() ){
     version = "1.0";
@@ -221,9 +224,9 @@ bool CGNTagger::init( const Configuration& conf ){
   else
     tagset = val;
   fillSubSetTable();
-  string init = "-s " + configuration.configDir() + settings + " -vcf";
+  string init = "-s " + settings + " -vcf";
   tagger = new MbtAPI( init, *cgnLog );
-  return tagger != 0;
+  return tagger->isInit();
 }
 
 string getSubSet( const string& val, const string& head ){
@@ -261,13 +264,20 @@ void CGNTagger::addTag( Word *word, const string& inputTag, double confidence ){
   string ucto_class = word->cls();
   if ( debug )
     *Log(cgnLog) << "ucto class= " << ucto_class << endl;
-  if ( ucto_class == "ABBREVIATION-KNOWN" ){
+  if ( ucto_class == "PUNCTUATION" && cgnTag.find("SPEC(") != string::npos ){
+    mainTag = "LET";
+    tagPartS = "";
+    cgnTag = "LET()";
+    confidence = 1.0;
+  }
+  else if ( ucto_class == "ABBREVIATION-KNOWN" ){
     mainTag = "SPEC";
     tagPartS = "afk";
     cgnTag = "SPEC(afk)";
     confidence = 1.0;
   }
   else if ( ucto_class == "SMILEY" ||
+	    ucto_class == "REVERSE-SMILEY" ||
 	    ucto_class.find("URL") == 0 ||
 	    ucto_class == "E-MAIL" ){
     mainTag = "SPEC";
@@ -298,7 +308,7 @@ void CGNTagger::addTag( Word *word, const string& inputTag, double confidence ){
     pos = word->addPosAnnotation( args );
   }
   vector<string> tagParts;
-  size_t numParts = Timbl::split_at( tagPartS, tagParts, "," );
+  size_t numParts = TiCC::split_at( tagPartS, tagParts, "," );
   for ( size_t i=0; i < numParts; ++i ){
     KWargs args;
     args["set"]    = tagset;
@@ -315,15 +325,17 @@ void CGNTagger::addTag( Word *word, const string& inputTag, double confidence ){
 void CGNTagger::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::POS, tagset,
 	       "annotator='frog-mbpos-" + version
-	       + "', annotatortype='auto'");
+	       + "', annotatortype='auto', datetime='" + getTime() + "'");
 }
 
-void CGNTagger::Classify( Sentence *sent ){
-  vector<Word*> swords;
-#pragma omp critical(foliaupdate)
-  {  
-    swords = sent->words();
-  }
+vector<TagResult> CGNTagger::tagLine( const string& line ){
+  if ( tagger )
+    return tagger->TagLine(line);
+  else
+    throw runtime_error( "CGNTagger is not initialized" );
+}
+
+void CGNTagger::Classify( const vector<Word*>& swords ){
   if ( !swords.empty() ) {
     vector<string> words;
     string sentence; // the tagger needs the whole sentence
@@ -337,6 +349,15 @@ void CGNTagger::Classify( Sentence *sent ){
       *Log(cgnLog) << "CGN tagger in: " << sentence << endl;
     vector<TagResult> tagv = tagger->TagLine(sentence);
     if ( tagv.size() != swords.size() ){
+      *Log(cgnLog) << "mismatch between number of <w> tags and the tagger result." << endl;
+      *Log(cgnLog) << "words according to <w> tags: " << endl;
+      for ( size_t w = 0; w < swords.size(); ++w ) {
+	*Log(cgnLog) << "w[" << w << "]= " << swords[w]->str() << endl;
+      }
+      *Log(cgnLog) << "words according to CGN tagger: " << endl;    
+      for ( size_t i=0; i < tagv.size(); ++i ){
+	*Log(cgnLog) << "word[" << i << "]=" << tagv[i].word() << endl;
+      }
       throw runtime_error( "CGN tagger is confused" );
     }
     if ( debug ){
diff --git a/src/frog-dp-update b/src/frog-dp-update
deleted file mode 100755
index 6294b85..0000000
--- a/src/frog-dp-update
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh
-
-frog -V
-
-if [ $? -ne 0 ]
-then
-    echo "unable to execute frog. Is it installed?"
-    exit 1
-fi
-
-set `frog -V`
-
-confdir=$2
-
-if ! test -d $confdir
-then
-    echo "frog didn't return a valid config dir. Maybe an old version?"
-    exit 1
-fi
-
-cd $confdir
-echo "entered frog config dir: " $confdir
-
-if test -e frog.cfg
-then
-    last=`ls frog.cfg.* |sort -V | tail -1 `
-    if [ "$last" = "" ]
-    then
-	cp frog.cfg frog.cfg.1
-	echo "created a backup copy of 'frog.cfg' :: 'frog.cfg.1'"
-    else
-#	echo found $last
-	new=frog.cfg.`echo $last | awk -F \. {'print ++$3'}`
-	cp frog.cfg $new
-	echo "created a backup copy of 'frog.cfg' :: '$new'"
-    fi
-fi
-
-echo "attempt to retrieve frog datafiles from http://ilk.uvt.nl/frog"
-
-\rm -f Frog*.gz
-
-wget http://ilk.uvt.nl/frog/Frog.mbdp-latest.tar.gz
-
-if [ $? -ne 0 ]
-then
-    echo "unable to retrieve frog data, please inform us:"
-    echo "send an e-mail to timbl at uvt.nl"
-    exit 1
-fi
-
-echo "unpacking: Frog.mbdp-latest.tar.gz"
-tar zxf Frog.mbdp-latest.tar.gz
-if [ $? -ne 0 ]
-then
-    echo "unable to unpack frog data, do you have enough rights?"
-    exit 1
-fi
-
-echo "done"
-
diff --git a/src/iob_tagger_mod.cxx b/src/iob_tagger_mod.cxx
index 920586a..19c90c2 100644
--- a/src/iob_tagger_mod.cxx
+++ b/src/iob_tagger_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: iob_tagger_mod.cxx 14481 2012-03-21 11:26:55Z sloot $
+  $Id: iob_tagger_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/iob_tagger_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -29,8 +29,6 @@
 */
 
 #include "mbt/MbtAPI.h"
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
 #include "frog/Frog.h"
 #include "frog/iob_tagger_mod.h"
 
@@ -51,7 +49,7 @@ bool IOBTagger::init( const Configuration& conf ){
   debug = tpDebug;
   string db = conf.lookUp( "debug", "IOB" );
   if ( !db.empty() )
-    debug = folia::stringTo<int>( db );
+    debug = TiCC::stringTo<int>( db );
   switch ( debug ){
   case 0:
   case 1:
@@ -81,7 +79,12 @@ bool IOBTagger::init( const Configuration& conf ){
     *Log(iobLog) << "Unable to find settings for IOB" << endl;
     return false;
   }
-  string settings = val;
+  string settings;
+  if ( val[0] == '/' ) // an absolute path
+    settings = val;
+  else
+    settings =  configuration.configDir() + val;
+
   val = conf.lookUp( "version", "IOB" );
   if ( val.empty() ){
     version = "1.0";
@@ -95,9 +98,9 @@ bool IOBTagger::init( const Configuration& conf ){
   else
     tagset = val;
 
-  string init = "-s " + configuration.configDir() + settings + " -vcf";
+  string init = "-s " + settings + " -vcf";
   tagger = new MbtAPI( init, *iobLog );
-  return tagger != 0;
+  return tagger->isInit();
 }
 
 void IOBTagger::addChunk( ChunkingLayer *chunks, 
@@ -124,6 +127,8 @@ void IOBTagger::addChunk( ChunkingLayer *chunks,
     }
   }
   for ( size_t i=0; i < words.size(); ++i ){
+    if ( words[i]->isinstance(PlaceHolder_t) )
+      continue;
 #pragma omp critical(foliaupdate)
     {
       chunk->append( words[i] );
@@ -131,13 +136,15 @@ void IOBTagger::addChunk( ChunkingLayer *chunks,
   }
 }
 
-void IOBTagger::addIOBTags( Sentence *sent, 
-			    const vector<Word*>& words,
+void IOBTagger::addIOBTags( const vector<Word*>& words,
 			    const vector<string>& tags,
 			    const vector<double>& confs ){
+  if ( words.empty() )
+    return;
   ChunkingLayer *el = 0;
 #pragma omp critical(foliaupdate)
   {
+    Sentence *sent = words[0]->sentence();
     try {
       el = sent->annotation<ChunkingLayer>();
     }
@@ -153,7 +160,7 @@ void IOBTagger::addIOBTags( Sentence *sent,
     if (debug) 
       *Log(iobLog) << "tag = " << tags[i] << endl;
     vector<string> tagwords;
-    size_t num_words = Timbl::split_at( tags[i], tagwords, "_" );
+    size_t num_words = TiCC::split_at( tags[i], tagwords, "_" );
     if ( num_words != 2 ){
       *Log(iobLog) << "expected <POS>_<IOB>, got: " << tags[i] << endl;
       exit( EXIT_FAILURE );
@@ -165,7 +172,7 @@ void IOBTagger::addIOBTags( Sentence *sent,
       if ( !stack.empty() ){
 	if (debug) {
 	  *Log(iobLog) << "O spit out " << curIOB << endl;
-	  using folia::operator<<;
+	  using TiCC::operator<<;
 	  *Log(iobLog) << "spit out " << stack << endl;	
 	}
 	addChunk( el, stack, dstack, curIOB );
@@ -175,7 +182,7 @@ void IOBTagger::addIOBTags( Sentence *sent,
       continue;
     }
     else {
-      num_words = Timbl::split_at( tagwords[1], iob, "-" );
+      num_words = TiCC::split_at( tagwords[1], iob, "-" );
       if ( num_words != 2 ){
 	*Log(iobLog) << "expected <IOB>-tag, got: " << tagwords[1] << endl;
 	exit( EXIT_FAILURE );
@@ -189,7 +196,7 @@ void IOBTagger::addIOBTags( Sentence *sent,
       if ( !stack.empty() ){
 	if ( debug ){
 	  *Log(iobLog) << "B spit out " << curIOB << endl;
-	  using folia::operator<<;
+	  using TiCC::operator<<;
 	  *Log(iobLog) << "spit out " << stack << endl;	
 	}
 	addChunk( el, stack, dstack, curIOB );
@@ -204,7 +211,7 @@ void IOBTagger::addIOBTags( Sentence *sent,
   if ( !stack.empty() ){
     if ( debug ){
       *Log(iobLog) << "END spit out " << curIOB << endl;
-      using folia::operator<<;
+      using TiCC::operator<<;
       *Log(iobLog) << "spit out " << stack << endl;	
     }
     addChunk( el, stack, dstack, curIOB );
@@ -215,15 +222,10 @@ void IOBTagger::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::CHUNKING, 
 	       tagset,
 	       "annotator='frog-chunker-" + version
-	       + "', annotatortype='auto'");
+	       + "', annotatortype='auto', datetime='" + getTime() + "'");
 }
 
-void IOBTagger::Classify( Sentence *sent ){
-  vector<Word*> swords;
-#pragma omp critical(foliaupdate)
-  {  
-    swords = sent->words();
-  }
+void IOBTagger::Classify( const vector<Word *>& swords ){
   if ( !swords.empty() ) {
     vector<string> words;
     string sentence; // the tagger needs the whole sentence
@@ -253,7 +255,7 @@ void IOBTagger::Classify( Sentence *sent ){
       tags.push_back( tagv[i].assignedTag() );
       conf.push_back( tagv[i].confidence() );
     }
-    addIOBTags( sent, swords, tags, conf );
+    addIOBTags( swords, tags, conf );
   }
 }
 
diff --git a/src/mblem_mod.cxx b/src/mblem_mod.cxx
index 6e6bae5..981d9a3 100755
--- a/src/mblem_mod.cxx
+++ b/src/mblem_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: mblem_mod.cxx 14525 2012-03-27 09:07:23Z sloot $
+  $Id: mblem_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/mblem_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -31,15 +31,13 @@
 #include <iostream>
 #include <fstream>
 #include "timbl/TimblAPI.h"
-
-#include "ucto/unicode.h"
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
+#include "ticcutils/LogStream.h"
+#include "ticcutils/Configuration.h"
 #include "frog/Frog.h"
-#include "frog/Configuration.h"
 #include "frog/mblem_mod.h"
 
 using namespace std;
+using namespace TiCC;
 using namespace folia;
 
 Mblem::Mblem(): myLex(0),punctuation( "?...,:;\\'`(){}[]%#+-_=/!" ), 
@@ -78,7 +76,7 @@ bool Mblem::init( const Configuration& config ) {
   debug = tpDebug;
   string db = config.lookUp( "debug", "mblem" );
   if ( !db.empty() )
-    debug = stringTo<int>( db );
+    debug = TiCC::stringTo<int>( db );
   string val = config.lookUp( "version", "mblem" );
   if ( val.empty() ){
     version = "1.0";
@@ -91,6 +89,13 @@ bool Mblem::init( const Configuration& config ) {
   }
   else
     tagset = val;
+
+  val = config.lookUp( "set", "tagger" );
+  if ( val.empty() ){
+    cgn_tagset = "http://ilk.uvt.nl/folia/sets/frog-mbpos-cgn";
+  }
+  else
+    cgn_tagset = val;
   
   string transName = config.lookUp( "transFile", "mblem" );
   if ( !transName.empty() ){
@@ -194,66 +199,106 @@ void Mblem::addAltLemma( Word *word, const string& cls ){
   addLemma( alt, cls );
 }
   
-string Mblem::postprocess( Word *word ){
-  string tag;
-#pragma omp critical(foliaupdate)
-  {
-    tag = word->pos();
-  }
-  size_t index = 0;
-  size_t nrlookup = mblemResult.size();
-  bool none=true;
-  string result;
-  while ( index < nrlookup  ){
+void Mblem::filterTag( const string& postag ){
+  vector<mblemData>::iterator it = mblemResult.begin();
+  while( it != mblemResult.end() ){
     if (debug)
-      *Log(mblemLog) << "compare cgn-tag " << tag << " with " << mblemResult[index].getTag() << endl;
-    if ( isSimilar( tag, mblemResult[index].getTag() ) ){
+      *Log(mblemLog) << "compare cgn-tag " << postag << " with " << it->getTag() << " ";
+    if ( isSimilar( postag, it->getTag() ) ){
       if ( debug )
 	*Log(mblemLog) << "similar! " << endl;
-      string res = mblemResult[index].getLemma();
-      if ( none ){
-	addLemma( word, res );
-	result = res;
-	none = false;
+      ++it;
+    }
+    else {
+      if ( debug )
+	*Log(mblemLog) << "NOT similar! " << endl;	
+      it = mblemResult.erase(it);
+    }
+  }
+  if ( debug && mblemResult.empty() )
+    *Log(mblemLog) << "NO CORRESPONDING TAG! " << postag << endl;
+}
+
+void Mblem::makeUnique( ){
+  vector<mblemData>::iterator it = mblemResult.begin();
+  while( it != mblemResult.end() ){
+    string lemma = it->getLemma();
+    vector<mblemData>::iterator it2 = it+1;
+    while( it2 != mblemResult.end() ){
+      if (debug)
+	*Log(mblemLog) << "compare lemma " << lemma << " with " << it2->getLemma() << " ";
+      if ( lemma == it2->getLemma() ){
+	if ( debug )
+	  *Log(mblemLog) << "equal " << endl;
+	it2 = mblemResult.erase(it2);
       }
       else {
-	// there are more matching lemmas. add them as alternatives
-	addAltLemma( word, res );
+	if ( debug )
+	  *Log(mblemLog) << "NOT equal! " << endl;	
+	++it2;
       }
     }
-    ++index;
+    ++it;
   }
-  
-  if ( none  ) {
-    if (debug)
-      *Log(mblemLog) << "NO CORRESPONDING TAG! " << tag << endl;
-    result = mblemResult[0].getLemma();
+}
+
+void Mblem::getFoLiAResult( Word *word, const UnicodeString& uWord ){
+  if ( mblemResult.empty() ){
+    // just return the word as a lemma
+    string result = UnicodeToUTF8( uWord );
     addLemma( word, result );
   }
-  return result;
+  else {
+    bool first = true;
+    vector<mblemData>::iterator it = mblemResult.begin();
+    while( it != mblemResult.end() ){
+      string result = it->getLemma();
+      if ( first ){
+	addLemma( word, result );
+	first = false;
+      }
+      else {
+	// there are more matching lemmas. add them as alternatives
+	addAltLemma( word, result );
+      }
+      ++it;
+    }
+  }
 } 
 
+
 void Mblem::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::LEMMA, 
 	       tagset,
 	       "annotator='frog-mblem-" + version
-	       + "', annotatortype='auto'");
+	       + "', annotatortype='auto', datetime='" + getTime() + "'");
 }
 
-string Mblem::Classify( Word *sword ){
+void Mblem::Classify( Word *sword ){
+  if ( sword->isinstance(PlaceHolder_t ) )
+    return;
   string word;
   string tag;
+  string pos;
 #pragma omp critical(foliaupdate)
   {  
     word = sword->str();
-    tag = sword->annotation<PosAnnotation>()->feat("head");
+    pos = sword->pos();
+    tag = sword->annotation<PosAnnotation>( cgn_tagset )->feat("head");
   }
   if ( tag == "SPEC" || tag == "LET" ) {
     addLemma( sword, word );
-    return word;
+    return;
   }
   UnicodeString uWord = UTF8ToUnicode(word);
   uWord.toLower();
+  Classify( uWord );
+  filterTag( pos ); 
+  makeUnique(); 
+  getFoLiAResult( sword, uWord ); 
+}
+
+void Mblem::Classify( const UnicodeString& uWord ){
   mblemResult.clear();
   string inst = make_instance(uWord);  
   string classString;
@@ -268,83 +313,39 @@ string Mblem::Classify( Word *sword ){
   }
   int index = 0;
   while ( index < numParts ) {
-    UnicodeString part = UTF8ToUnicode( parts[index++] );
-    if (debug)
-      *Log(mblemLog) <<"part = " << part << endl;
-    UnicodeString lemma = "";
+    string partS = parts[index++]; 
+    UnicodeString lemma;
     string restag;
-    int lpos = part.indexOf("+");
-    if ( lpos < 0 ){ // nothing to edit
-      restag = UnicodeToUTF8( part );
+    string::size_type pos = partS.find("+");
+    if ( pos == string::npos ){ 
+      // nothing to edit
+      restag = partS;
       lemma = uWord;
     }
     else {
-      restag = UnicodeToUTF8( UnicodeString( part, 0, lpos ) );
-      UnicodeString editstr = UnicodeString( part, lpos );
+      // some edit info available, like: WW(27)+Dgekomen+Ikomen
+      vector<string> edits;
+      size_t n = split_at( partS, edits, "+" );
+      if ( n < 1 )
+	throw runtime_error( "invalid editstring: " + partS );
+      restag = edits[0]; // the first one is the POS tag
+
       UnicodeString insstr;
       UnicodeString delstr;
       UnicodeString prefix;
-      bool done = false;
-      for ( int lpos=0; !done && lpos < editstr.length(); ++lpos ) {
-	if ( debug )
-	  *Log(mblemLog) << "editstr[" << lpos << "] = " 
-			 << UnicodeToUTF8(editstr[lpos]) << endl;
-	switch( editstr[lpos] ) {
-	case 'P': {
-	  if (editstr[lpos-1] =='+') {
-	    lpos++;
-	    int tmppos = editstr.indexOf("+", lpos);
-	    if ( debug )
-	      *Log(mblemLog) << "tmppos = " << tmppos << endl;
-	    if ( tmppos >=0 ){
-	      prefix = UnicodeString( editstr, lpos, tmppos - lpos );
-	      lpos = tmppos - 1;
-	    }
-	    else {
-	      prefix = UnicodeString( editstr, lpos );
-	      done = true;
-	    }
-	    if (debug)
-	      *Log(mblemLog) << "prefix=" << prefix << endl;
-	  }
+      for ( size_t l=1; l < edits.size(); ++l ) {
+	switch ( edits[l][0] ){
+	case 'P':
+	  prefix = UTF8ToUnicode( edits[l].substr( 1 ) );
 	  break;
-	}
-	case 'D': {
-	  if (editstr[lpos-1] =='+') {
-	    lpos++;
-	    int tmppos = editstr.indexOf("+", lpos);
-	    if ( tmppos >= 0 ){
-	      delstr = UnicodeString( editstr, lpos, tmppos - lpos );
-	      lpos = tmppos - 1;
-	    }
-	    else {
-	      delstr = UnicodeString( editstr, lpos );
-	      done = true;
-	    }
-	    if (debug)
-	      *Log(mblemLog) << "delstr=" << delstr << endl;
-	  }
+	case 'I':
+	  insstr = UTF8ToUnicode( edits[l].substr( 1 ) );
 	  break;
-	}
-	case 'I': {
-	  if (editstr[lpos-1] =='+') {
-	    lpos++;
-	    int tmppos = editstr.indexOf("+", lpos);
-	    if ( tmppos >=0 ){
-	      insstr = UnicodeString( editstr, lpos, tmppos - lpos);
-	      lpos = tmppos - 1;
-	    }
-	    else {
-	      insstr = UnicodeString( editstr, lpos);
-	      done = true;
-	    }
-	    if (debug)
-	      *Log(mblemLog) << "insstr=" << insstr << endl;
-	  }
+	case 'D':
+	  delstr =  UTF8ToUnicode( edits[l].substr( 1 ) );
 	  break;
-	}
 	default:
-	  break;
+	  *Log(mblemLog) << "Error: strange value in editstring: " << edits[l] << endl;
 	}
       }
       if (debug){
@@ -353,6 +354,9 @@ string Mblem::Classify( Word *sword ){
       }	
       int prefixpos = 0;
       if ( !prefix.isEmpty() ) {
+	// Whenever Toads makemblem is improved, (the infamous 
+	// 'tegemoetgekomen' example), this should probably
+	// become prefixpos = uWord.lastIndexOf(prefix);
 	prefixpos = uWord.indexOf(prefix);
 	if (debug)
 	  *Log(mblemLog) << "prefixpos = " << prefixpos << endl;
@@ -370,20 +374,24 @@ string Mblem::Classify( Word *sword ){
 	prefixpos = prefixpos + prefix.length();
       }
       if (debug)
-	*Log(mblemLog) << "post prefix != 0 word: "<< uWord 
+	*Log(mblemLog) << "post word: "<< uWord 
 		       << " lemma: " << lemma
 		       << " prefix: " << prefix
-		       << " insstr: " << insstr
 		       << " delstr: " << delstr
-		       << " l_delstr=" << delstr.length()
-		       << " l_word=" << uWord.length()
+		       << " insstr: " << insstr
 		       << endl;
       
       if ( uWord.endsWith( delstr ) ){
 	if ( uWord.length() > delstr.length() ){
 	  // chop delstr from the back, but do not delete the whole word
-	  UnicodeString part = UnicodeString( uWord, prefixpos, uWord.length() - delstr.length() - prefixpos );
-	  lemma += part + insstr;
+	  if ( uWord.length() == delstr.length() + 1  && insstr.isEmpty() ){
+	    // do not mangle short words too
+	    lemma += uWord;
+	  }
+	  else {
+	    UnicodeString part = UnicodeString( uWord, prefixpos, uWord.length() - delstr.length() - prefixpos );
+	    lemma += part + insstr;
+	  }
 	}
 	else if ( insstr.isEmpty() ){
 	  // no replacement, just take part after the prefix
@@ -423,6 +431,13 @@ string Mblem::Classify( Word *sword ){
 		     << "\ttag alt: " << mblemResult[index].getTag() << endl;
     }
   }
-  string res = postprocess( sword ); 
-  return res;
+}
+
+vector<pair<string,string> > Mblem::getResult() const {
+  vector<pair<string,string> > result;
+  for ( size_t i=0; i < mblemResult.size(); ++i ){
+    result.push_back( make_pair( mblemResult[i].getLemma(),
+				 mblemResult[i].getTag() ) );
+  }
+  return result;
 }
diff --git a/src/mblem_prog.cxx b/src/mblem_prog.cxx
new file mode 100644
index 0000000..fc8df21
--- /dev/null
+++ b/src/mblem_prog.cxx
@@ -0,0 +1,225 @@
+/*
+  $Id:$
+  $URL:$
+
+  Copyright (c) 2006 - 2013
+  Tilburg University
+
+  A Morphological-Analyzer for Dutch
+ 
+  This file is part of frog
+
+  frog 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.
+
+  frog 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 <http://www.gnu.org/licenses/>.
+
+  For questions and suggestions, see:
+      http://ilk.uvt.nl/software.html
+  or send mail to:
+      timbl at uvt.nl
+*/
+
+
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <vector>
+#include <map>
+
+#include "config.h"
+#include "timbl/TimblAPI.h"
+#include "ticcutils/LogStream.h"
+#include "ticcutils/Configuration.h"
+#include "libfolia/folia.h"
+#include "frog/ucto_tokenizer_mod.h"
+#include "frog/cgn_tagger_mod.h"
+#include "frog/mblem_mod.h"
+
+using namespace std;
+using namespace Timbl;
+
+LogStream my_default_log( cerr, "", StampMessage ); // fall-back
+LogStream *theErrLog = &my_default_log;  // fill the externals
+int tpDebug = 0; //0 for none, more for more output
+
+string TestFileName;
+string ProgName;
+bool doAll = false;
+
+Configuration configuration;
+static string configDir = string(SYSCONF_PATH) + "/" + PACKAGE + "/";
+static string configFileName = configDir + "frog.cfg";
+
+static UctoTokenizer tokenizer;
+static CGNTagger tagger;
+
+void usage( ) {
+  cout << endl << "mblem [options] testfile" << endl
+       << "Options:n" << endl;
+  cout << "\t============= INPUT MODE (mandatory, choose one) ========================\n"
+       << "\t -t <testfile>    Run mblem on this file\n"
+       << "\t -a               give ALL result. Not just the chosen one(s)\n"
+       << "\t -c <filename>    Set configuration file (default " << configFileName << ")\n"
+       << "\t============= OTHER OPTIONS ============================================\n"
+       << "\t -h. give some help.\n"
+       << "\t -V or --version .   Show version info.\n"
+       << "\t -d <debug level>    (for more verbosity)\n";
+}
+
+static Mblem myMblem;
+
+bool parse_args( TimblOpts& Opts ) {
+  cerr << "start " << Opts << endl;
+  string value;
+  bool mood;
+  if ( Opts.Find('V', value, mood ) ||
+       Opts.Find("version", value, mood ) ){
+    // we already did show what we wanted.
+    exit( EXIT_SUCCESS );
+  }
+  if ( Opts.Find ('h', value, mood)) {
+    usage();
+    exit( EXIT_SUCCESS );
+  };
+  // is a config file specified?
+  if ( Opts.Find( 'c',  value, mood ) ) {
+    configFileName = value;
+    Opts.Delete( 'c' );
+  };
+
+  if ( configuration.fill( configFileName ) ){
+    cerr << "config read from: " << configFileName << endl;
+  }
+  else {
+    cerr << "failed to read configuration from! '" << configFileName << "'" << endl;
+    cerr << "did you correctly install the frogdata package?" << endl;
+    return false;
+  }
+
+  // debug opts
+  if ( Opts.Find ('d', value, mood)) {
+    int debug = 0;
+    if ( !TiCC::stringTo<int>( value, debug ) ){
+      cerr << "-d value should be an integer" << endl;
+      return false;
+    }
+    configuration.setatt( "debug", value, "mblem" );
+    Opts.Delete('d');
+  };
+
+  if ( Opts.Find( 't', value, mood )) {
+    TestFileName = value;
+    ifstream is( value.c_str() );
+    if ( !is ){
+      cerr << "input stream " << value << " is not readable" << endl;
+      return false;
+    }
+    Opts.Delete('t');
+  }
+  else if ( Opts.Find( '?', value, mood )) {
+    TestFileName = value;
+    ifstream is( value.c_str() );
+    if ( !is ){
+      cerr << "input stream " << value << " is not readable" << endl;
+      return false;
+    }
+    Opts.Delete('?');
+  };
+  if ( Opts.Find( 'a', value, mood )) {
+    doAll = true;
+    Opts.Delete('t');
+  };
+  return true;
+}
+
+bool init(){  
+  // for some modules init can take a long time
+  // so first make sure it will not fail on some trivialities
+  //
+  if ( !myMblem.init( configuration ) ){
+    cerr << "MBLEM Initialization failed." << endl;
+    return false;
+  }
+  if ( !tokenizer.init( configuration, "", false ) ){
+    cerr << "UCTO Initialization failed." << endl;
+    return false;
+  }
+  if ( !tagger.init( configuration ) ){
+    cerr << "CGN Initialization failed." << endl;
+    return false;
+  }
+  cerr << "Initialization done." << endl;
+  return true;
+}
+
+void Test( istream& in ){
+  string line;
+  while ( getline( in, line ) ){
+    vector<string> sentences = tokenizer.tokenize( line );
+    for ( size_t s=0; s < sentences.size(); ++s ){
+      vector<TagResult> tagv = tagger.tagLine(sentences[s]);
+      for ( size_t w=0; w < tagv.size(); ++w ){
+	UnicodeString uWord = folia::UTF8ToUnicode(tagv[w].word());
+	myMblem.Classify( uWord );
+	if ( !doAll )
+	  myMblem.filterTag( tagv[w].assignedTag() );
+	vector<pair<string,string> > res = myMblem.getResult();
+	cout << tagv[w].word() << " {" << tagv[w].assignedTag() << "}\t";
+	for ( size_t i=0; i < res.size(); ++i ){
+	  cout << res[i].first << "[" << res[i].second << "]";
+	  if ( i < res.size()-1 )
+	    cout << "/";
+	}
+	cout << endl;
+      }
+      cout << "<utt>" << endl << endl;
+    }
+    cout << endl;
+  }
+  return;
+}
+
+
+int main(int argc, char *argv[]) {
+  std::ios_base::sync_with_stdio(false);
+  cerr << "mblem " << VERSION << " (c) ILK 1998 - 2013" << endl;
+  cerr << "Induction of Linguistic Knowledge Research Group, Tilburg University" << endl;
+  ProgName = argv[0];
+  cerr << "based on [" << Timbl::VersionName() << "]" << endl;
+  cerr << "configdir: " << configDir << endl;
+  try {
+    TimblOpts Opts(argc, argv);
+    if ( parse_args(Opts) ){
+      if (  !init() ){
+	cerr << "terminated." << endl;
+	return EXIT_FAILURE;
+      }
+      ifstream in(TestFileName.c_str() );
+      if ( in.good() ){
+	Test( in );
+      }
+      else {
+	cerr << "unable to open: " << TestFileName << endl;
+	return EXIT_FAILURE;
+      }
+    }
+    else {
+      return EXIT_FAILURE;
+    }
+  }
+  catch ( const exception& e ){
+    cerr << "fatal error: " << e.what() << endl;
+    return EXIT_FAILURE;
+  }
+  return EXIT_SUCCESS;
+}
diff --git a/src/mbma_mod.cxx b/src/mbma_mod.cxx
index 58432b2..bf145ba 100755
--- a/src/mbma_mod.cxx
+++ b/src/mbma_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: mbma_mod.cxx 14501 2012-03-22 13:00:16Z sloot $
+  $Id: mbma_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/mbma_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -34,18 +34,17 @@
 #include <timbl/TimblAPI.h>
 
 #include "frog/Frog.h"
-#include "frog/Configuration.h"
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
+#include "ticcutils/Configuration.h"
 #include "frog/mbma_mod.h"
 
 using namespace std;
 using namespace folia;
+using namespace TiCC;
 
 const long int LEFT =  6; // left context
 const long int RIGHT = 6; // right context
 
-Mbma::Mbma(): MTreeFilename( "dm.igtree" ), MTree(0) { 
+Mbma::Mbma(): MTreeFilename( "dm.igtree" ), MTree(0), transliterator(0) { 
   mbmaLog = new LogStream( theErrLog, "mbma-" );
 }
 
@@ -129,13 +128,24 @@ void Mbma::init_cgn( const string& dir ) {
   else
     throw ( runtime_error( "unable to open:" + fn ) );
 }
+
+void Mbma::init_filter( ){
+  UErrorCode stat = U_ZERO_ERROR;
+  transliterator = Transliterator::createInstance( "NFD; [:M:] Remove; NFC",
+						   UTRANS_FORWARD,
+						   stat );
+  if ( U_FAILURE( stat ) ){
+    throw runtime_error( "initFilter FAILED !" );
+  }
+}
+
   
 bool Mbma::init( const Configuration& config ) {
   *Log(mbmaLog) << "Initiating morphological analyzer..." << endl;
   debugFlag = tpDebug;
   string db = config.lookUp( "debug", "mbma" );
   if ( !db.empty() )
-    debugFlag = stringTo<int>( db );
+    debugFlag = TiCC::stringTo<int>( db );
   string val = config.lookUp( "version", "mbma" );
   if ( val.empty() ){
     version = "1.0";
@@ -148,13 +158,25 @@ bool Mbma::init( const Configuration& config ) {
   }
   else
     tagset = val;
+
+  val = config.lookUp( "set", "tagger" );
+  if ( val.empty() ){
+    cgn_tagset = "http://ilk.uvt.nl/folia/sets/frog-mbpos-cgn";
+  }
+  else
+    cgn_tagset = val;
+
   string tfName = config.lookUp( "treeFile", "mbma" );
   if ( tfName.empty() )
     tfName = "mbma.igtree";
   MTreeFilename = prefix( config.configDir(), tfName );
   fillMaps();
   init_cgn( config.configDir() );
-    //Read in (igtree) data
+  string dof = config.lookUp( "filter_diacritics", "mbma" );
+  if ( dof == "true" || dof == "TRUE" || dof =="yes" || dof == "YES" ){
+    init_filter();
+  }
+  //Read in (igtree) data
   string opts = config.lookUp( "timblOpts", "mbma" );
   if ( opts.empty() )
     opts = "-a1";
@@ -203,33 +225,25 @@ vector<string> Mbma::make_instances( const UnicodeString& word ){
 }
   
 string extract( const string& line, size_t start, char to ){
-  return line.substr( start, line.find( to , start ) - start );
-}
-
-string find_class( unsigned int step, 
-		   const vector<string>& classes,
-		   unsigned int nranal ){
-  string result = classes[0];
-  if ( nranal > 1 ){
-    if ( classes.size() > 1 ){
-      if ( classes.size() >= step )
-	result = classes[step-1];
-      else
-	result = "0";
-    }
+  string::size_type pos = line.find( to , start );
+  if ( to == '>' && pos == string::npos ){
+    cerr << "invalid edit value in line " << line << endl;
+    return "";
   }
-  return result;
+  return line.substr( start, pos - start );
 }
-  
+
 string Mbma::calculate_ins_del( const string& in_class, 
 				string& deletestring,
-				string& insertstring ){
+				string& insertstring,
+				bool& participle ){
   string result_class = in_class;
   size_t pos = in_class.find("+");
   if ( pos != string::npos ) { 
     if ( debugFlag){
       *Log(mbmaLog) << "calculate ins/del for " << in_class << endl;
     }
+    participle = ( in_class.find( 'p' ) < pos );
     pos++;
     if (in_class[pos]=='D') { // delete operation 
       deletestring = extract( in_class, pos+1, '/' );
@@ -255,6 +269,7 @@ string Mbma::calculate_ins_del( const string& in_class,
   else {
     if ( debugFlag ){
       *Log(mbmaLog) << "calculate_ins_del: do nothing" << endl;
+      *Log(mbmaLog) << "result class=" << result_class << endl;
     }
   }
   return result_class;
@@ -273,7 +288,7 @@ ostream& operator<< ( ostream& os, const vector<waStruct>& V ){
 }
 
 vector<waStruct> Mbma::Step1( unsigned int step, 
-			      const UnicodeString& word, int nranal,
+			      const UnicodeString& word,
 			      const vector<vector<string> >& classParts,
 			      const string& basictags ) {
   vector<waStruct> ana;
@@ -282,13 +297,14 @@ vector<waStruct> Mbma::Step1( unsigned int step,
   string previoustag;
   waStruct waItem;
   for ( long k=0; k < word.length(); ++k ) { 
-    this_class = find_class( step, classParts[k], nranal );
+    this_class = classParts[step][k];
     if ( debugFlag){
       *Log(mbmaLog) << "Step::" << step << " " << this_class << endl;
     }
     string deletestring;
     string insertstring;
-    this_class = calculate_ins_del( this_class, deletestring, insertstring);
+    bool participle = false;
+    this_class = calculate_ins_del( this_class, deletestring, insertstring, participle );
     if ( deletestring == "eeer" )
       deletestring = "eer";
     /* exceptions */
@@ -298,16 +314,16 @@ vector<waStruct> Mbma::Step1( unsigned int step,
       eexcept = true;
     }
     // insert the deletestring :-) 
-    UnicodeString last = UTF8ToUnicode( deletestring );
-    waItem.word += last;
+    UnicodeString dels = UTF8ToUnicode( deletestring );
+    waItem.word += dels;
     // delete the insertstring :-) 
-    if (( tobeignored == 0 ) &&
-	( insertstring != "ge" ) &&
-	( insertstring != "be" ) )
+    if ( tobeignored == 0 &&
+	 ( !participle || 
+	   ( insertstring != "ge" &&
+	     insertstring != "be" ) ) )
       tobeignored = insertstring.length();
     
-    if ( basictags.find(this_class[0]) != string::npos &&
-	 this_class != "PE" ) { 
+    if ( basictags.find(this_class[0]) != string::npos ){
       // encountering POS tag
       if ( !previoustag.empty() ) { 
 	waItem.act = previoustag;
@@ -318,6 +334,7 @@ vector<waStruct> Mbma::Step1( unsigned int step,
     }
     else { 
       if ( this_class[0] !='0' ){ 
+	// encountering inflection info
 	if ( !previoustag.empty() ) { 
 	  waItem.act = previoustag;
 	  ana.push_back( waItem );
@@ -344,6 +361,7 @@ vector<waStruct> Mbma::Step1( unsigned int step,
   // do we have inflection?
   size_t pos = this_class.find( '/' );
   if ( pos != string::npos && this_class != "E/P" ) { 
+    // tags like 0/te3 N/e 0/P etc.
     string inflection = "i" + this_class.substr( pos+1 );
     waItem.act = inflection;
     ana.push_back( waItem );
@@ -351,7 +369,7 @@ vector<waStruct> Mbma::Step1( unsigned int step,
   return ana;
 }
 
-string change_tag( const char ch ){
+string select_tag( const char ch ){
   string newtag;
   switch( ch ){
   case 'm':
@@ -384,34 +402,36 @@ string change_tag( const char ch ){
 void Mbma::resolve_inflections( vector<waStruct>& ana, 
 				const string& basictags ) {
   // resolve all clearly resolvable implicit selections of inflectional tags
-  vector<waStruct>::iterator prev = ana.begin();
-  vector<waStruct>::const_iterator it = ana.begin();
-  int step = 0;
-  while ( it != ana.end() ){
-    string this_class = it->act;
-    if ( step > 1 ){
-      ++prev;
-    }
-    ++it;
-    ++step;
-    if ( this_class[0]=='i') { 
+  for ( vector<waStruct>::iterator it = ana.begin(); 
+	it != ana.end(); 
+	++it ){
+    if ( ana.begin() == it )
+      continue; // start at second
+    string act = it->act;
+    if ( act[0]=='i') { 
+      // it is an inflection tag
       if (debugFlag){
-	*Log(mbmaLog) << "thisclass >" << this_class << "<" << endl;
+	*Log(mbmaLog) << "act: >" << act << "<" << endl;
       }	  
-      /* given the specific selections of certain inflections,
-	 change the tag!  */
-      string newtag = change_tag( this_class[1] );
+      // given the specific selections of certain inflections,
+      //    select a tag!
+      string new_tag = select_tag( act[1] );
       
-      /* apply the change. Remember, the idea is that an inflection is
-	 far more certain of the tag of its predecessing morpheme than
-	 the morpheme itself. This is not always the case, but it works  */
-      if ( !newtag.empty() ) {
+      // apply the change. Remember, the idea is that an inflection is
+      // far more certain of the tag of its predecessing morpheme than
+      // the morpheme itself. 
+      // This is not always the case, but it works
+      if ( !new_tag.empty() ) {
 	if ( debugFlag  ){
-	  *Log(mbmaLog) << "selects " << newtag << endl;
+	  *Log(mbmaLog) << act[1] << " selects " << new_tag << endl;
 	}
-	/* go left */
-	if ( basictags.find(prev->act[0]) != string::npos ){
-	  prev->act[0] = newtag[0];
+	// change the previous act
+	if ( basictags.find((it-1)->act[0]) != string::npos ){
+	  if ( debugFlag  ){
+	    *Log(mbmaLog) << "replace " << (it-1)->act[0] << " by " 
+			  << new_tag[0] << endl;
+	  }
+	  (it-1)->act[0] = new_tag[0];
 	}
       }
     }
@@ -421,17 +441,20 @@ void Mbma::resolve_inflections( vector<waStruct>& ana,
 MBMAana Mbma::addInflect( const vector<waStruct>& ana,
 			  const string& inflect, 
 			  const vector<string>& morph ){
-  bool found = false;
   string the_act;
   vector<waStruct>::const_reverse_iterator it = ana.rbegin();
-  while ( !found && it != ana.rend() ) { 
+  while ( it != ana.rend() ) { 
     // go back to the last non-inflectional tag 
     the_act = it->act;
     if (debugFlag){
-      *Log(mbmaLog) << "final tag " << the_act << endl;
+      *Log(mbmaLog) << "examine act " << the_act << endl;
+    }
+    if ( the_act[0] != 'i' ){
+      if (debugFlag){
+	*Log(mbmaLog) << "final tag " << the_act << endl;
+      }
+      break;
     }
-    if ( the_act[0] != 'i' )
-      found=true;
     else { 
       ++it;
     }
@@ -446,17 +469,15 @@ MBMAana Mbma::addInflect( const vector<waStruct>& ana,
   map<string,string>::const_iterator tit = tagNames.find( tag ); 
   if ( tit == tagNames.end() ){
     // unknown tag
-    if (debugFlag)
-      *Log(mbmaLog) << "added X 4" << endl;
     outTag = "X";
     descr = "unknown";
   }
   else {
-    if (debugFlag)
-      *Log(mbmaLog) << "added (4) " << tit->second << endl;
     outTag = tit->first;
     descr = tit->second;
   }
+  if (debugFlag)
+    *Log(mbmaLog) << "added (4) " << outTag << " " << descr << endl;
   return MBMAana( outTag, inflect, morph, descr );
 }
 
@@ -499,26 +520,33 @@ MBMAana Mbma::inflectAndAffix( const vector<waStruct>& ana ){
   }
   if (debugFlag)	
     *Log(mbmaLog) << "inflectAndAffix: " << inflect << " - " << morphemes << endl;
-  if ( inflect.empty() ){
-    if (debugFlag)
-      *Log(mbmaLog) << "Inflection: none " << endl;
-    MBMAana retVal;
-    return retVal;
-  }
-  else {
-    // go back to the last non-inflectional
-    // tag and stick it at the end
-    MBMAana retVal = addInflect( ana, inflect, morphemes );
-    if (debugFlag)
-      *Log(mbmaLog) << "Inflection: " << retVal << endl;
-    return retVal;
+  // go back to the last non-inflectional
+  // tag and stick it at the end. 
+  MBMAana retVal = addInflect( ana, inflect, morphemes );
+  if (debugFlag)
+    *Log(mbmaLog) << "Inflection: " << retVal << endl;
+  return retVal;
+}
+
+#define OLD_STEP
+
+#ifdef OLD_STEP
+string find_class( unsigned int step, 
+		   const vector<string>& classes,
+		   unsigned int nranal ){
+  string result = classes[0];
+  if ( nranal > 1 ){
+    if ( classes.size() > 1 ){
+      if ( classes.size() > step )
+	result = classes[step];
+      else
+	result = "0";
+    }
   }
+  return result;
 }
 
-void Mbma::execute( const UnicodeString& word, 
-		    const vector<string>& classes ){
-  const string basictags = "NAQVDOBPYIXZ";
-  analysis.clear();
+vector<vector<string> > generate_all_perms( const vector<string>& classes ){
   // determine all alternative analyses, remember the largest
   // and store every part in a vector of string vectors
   int largest_anal=1;
@@ -539,19 +567,92 @@ void Mbma::execute( const UnicodeString& word,
       classParts[j] = dummy;
     }
   }
+  //
+  // now expand the result
+  vector<vector<string> > result;
+  for ( int step=0; step < largest_anal; ++step ){
+    vector<string> item(classParts.size());
+    for ( size_t k=0; k < classParts.size(); ++k ) { 
+      item[k] = find_class( step, classParts[k], largest_anal );
+    }
+    result.push_back( item );
+  }
+  return result;
+}
+#else  
+
+bool next_perm( vector< vector<string>::const_iterator >& its,
+		const vector<vector<string> >& parts ){
+  for ( size_t i=0; i < parts.size(); ++i ){
+    ++its[i];
+    if ( its[i] == parts[i].end() ){
+      if ( i == parts.size() -1 )
+	return false;
+      its[i] = parts[i].begin();
+    }
+    else 
+      return true;
+  }
+  return false;
+}
+
+vector<vector<string> > generate_all_perms( const vector<string>& classes ){
   
-  if (debugFlag){
+  // determine all alternative analyses
+  // store every part in a vector of string vectors
+  vector<vector<string> > classParts;
+  classParts.resize( classes.size() );
+  for ( unsigned int j=0; j< classes.size(); ++j ){
+    vector<string> parts;
+    int num = split_at( classes[j], parts, "|" );
+    if ( num > 0 ){
+      classParts[j] = parts;
+    }
+    else {
+      // only one, create a dummy
+      vector<string> dummy;
+      dummy.push_back( classes[j] );
+      classParts[j] = dummy;
+    }
+  }
+  //
+  // now expand
+  vector< vector<string>::const_iterator > its( classParts.size() );
+  for ( size_t i=0; i<classParts.size(); ++i ){
+    its[i] = classParts[i].begin();
+  }
+  vector<vector<string> > result;
+  bool more = true;
+  while ( more ){
+    vector<string> item(classParts.size());
+    for( size_t j=0; j< classParts.size(); ++j ){
+      item[j] = *its[j];
+    }
+    result.push_back( item );
+    more = next_perm( its, classParts );
+  }
+  return result;
+}
+#endif
+
+void Mbma::execute( const UnicodeString& word, 
+		    const vector<string>& classes ){
+  const string basictags = "NAQVDOBPYIXZ";
+  analysis.clear();
+
+  vector<vector<string> > allParts = generate_all_perms( classes );
+  if ( debugFlag ){
     string out = "alternatives: word=" + UnicodeToUTF8(word) + ", classes=<";
     for ( size_t i=0; i < classes.size(); ++i )
       out += classes[i] + ",";
     out += ">";
     *Log(mbmaLog) << out << endl;
+    *Log(mbmaLog) << "allParts : " << allParts << endl;
   }    
   
   // now loop over all the analysis
-  for ( unsigned int step=largest_anal; step> 0; --step ) { 
-    vector<waStruct> ana = Step1( step, word, largest_anal, 
-				  classParts, basictags );
+  for ( unsigned int step=0; step < allParts.size(); ++step ) { 
+    vector<waStruct> ana = Step1( step, word, allParts, basictags );
     if (debugFlag)
       *Log(mbmaLog) << "intermediate analysis 1: " << ana << endl;
     resolve_inflections( ana, basictags );
@@ -563,13 +664,30 @@ void Mbma::execute( const UnicodeString& word,
   }
 }
 
+void Mbma::addAltMorph( Word *word, 
+			const vector<string>& lemmas ) const {
+  Alternative *alt = new Alternative();
+  MorphologyLayer *ml = new MorphologyLayer();
+#pragma omp critical(foliaupdate)
+  {
+    alt->append( ml );
+    word->append( alt );
+  }
+  addMorph( ml, lemmas );
+}
+
 void Mbma::addMorph( Word *word, 
-		     const vector<string>& lemmas ){
+		     const vector<string>& lemmas ) const {
   MorphologyLayer *ml = new MorphologyLayer();
 #pragma omp critical(foliaupdate)
   {
     word->append( ml );
   }
+  addMorph( ml, lemmas );
+}
+
+void Mbma::addMorph( MorphologyLayer *ml, 
+		     const vector<string>& lemmas ) const {
   int offset = 0;
   for ( size_t p=0; p < lemmas.size(); ++p ){
     Morpheme *m = new Morpheme();
@@ -588,170 +706,217 @@ void Mbma::addMorph( Word *word,
     }
   }
 }	  
-      
-void Mbma::postprocess( Word *fword, PosAnnotation *pos ){
+
+void Mbma::filterTag( const string& head,  const vector<string>& feats ){
+  // first we select only the matching heads
   if (debugFlag){
+    *Log(mbmaLog) << "filter with tag, head: " << head 
+		  << " feats: " << feats << endl;
+    *Log(mbmaLog) << "filter:start, analysis is:" << endl;
+    int i=1;
     for(vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
-      *Log(mbmaLog) << "tag " <<  it->getTag() + " inflection: " << it->getInflection() << endl;
-    *Log(mbmaLog) << "morph analyses: " << endl;;
-    for (vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
-      *Log(mbmaLog) << it->getMorph() << endl;
-    *Log(mbmaLog) << "before morpho: " << endl;
-  }
-  const string tag = pos->feat("head");
-  map<string,string>::const_iterator tagIt = TAGconv.find( tag );
+      *Log(mbmaLog) << i++ << " - " << *it << endl;
+  }
+  map<string,string>::const_iterator tagIt = TAGconv.find( head );
   if ( tagIt == TAGconv.end() ) {
-    //
     // this should never happen
-    //
-    if (debugFlag){
-      *Log(mbmaLog) << "no match!" << endl;
-    } 
-    throw ValueError( "unknown pos tag value '" + tag + "'" );
+    throw ValueError( "unknown head feature '" + head + "'" );
   }
-  else {
-    if (debugFlag){
-      *Log(mbmaLog) << "#matches: " << tagIt->first << " " << tagIt->second << endl;
+  if (debugFlag){
+    *Log(mbmaLog) << "#matches: " << tagIt->first << " " << tagIt->second << endl;
+  }
+  vector<MBMAana>::iterator ait = analysis.begin();
+  while ( ait != analysis.end() ){
+    if ( tagIt->second == ait->getTag() ) {
+      if (debugFlag)
+	*Log(mbmaLog) << "comparing " << tagIt->second << " with " 
+		      << ait->getTag() << " (OK)" << endl;
+      ait++;
     }
-    size_t match = 0;	
-    vector<size_t> matches;
-    for ( size_t m_index = 0; m_index <analysis.size(); ++m_index ) {
+    else {
       if (debugFlag)
-	*Log(mbmaLog) << "comparing " << tagIt->second << " with " << analysis[m_index].getTag() << endl;
-      if ( tagIt->second == analysis[m_index].getTag() ) {
-	match++;
-	matches.push_back( m_index );
-      }
+	*Log(mbmaLog) << "comparing " << tagIt->second << " with " 
+		      << ait->getTag() << " (rejected)" << endl;
+      ait = analysis.erase( ait );
     }
-    if (debugFlag) {
-      *Log(mbmaLog) << "main tag " << tagIt->second
-		    << " matches " << match 
-		    << " morpho analyses: " << endl;
-      for( size_t p=0; p < match; ++p )  {
-	*Log(mbmaLog) << "\tmatch #" << p << " : " << analysis[matches[p]].getMorph() << endl;
-      }
+  }
+  if (debugFlag){
+    *Log(mbmaLog) << "filter: analysis after first step" << endl;
+    int i=1;
+    for(vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
+      *Log(mbmaLog) << i++ << " - " << *it << endl;
+  }
+
+  if ( analysis.size() < 1 ){
+    if (debugFlag ){
+      *Log(mbmaLog) << "analysis has size: " << analysis.size() 
+		    << " so skip next filter" << endl;
     }
-    //should be(come?) a switch
-    if ( match == 0 ) {
-      // fallback option: use the word and pretend it's a lemma ;-)
-      UnicodeString word;
-#pragma omp critical(foliaupdate)
-      {
-	word = fword->text();
-      }
-      word.toLower();
-      vector<string> tmp;
-      tmp.push_back( UnicodeToUTF8(word) );
-      addMorph( fword, tmp );
+    return;
+  }
+  // ok there are several analysis left.
+  // try to select on the features:
+  //
+  // find best match
+  // loop through all subfeatures of the tag
+  // and match with inflections from each m
+  set<const MBMAana *> bestMatches;
+  int max_count = 0;
+  for ( size_t q=0; q < analysis.size(); ++q ) {
+    int match_count = 0;
+    string inflection = analysis[q].getInflection();
+    if (debugFlag){
+      *Log(mbmaLog) << "matching " << inflection << " with " << feats << endl;
     }
-    else if (match == 1) {
-      const vector<string> ma = analysis[matches[0]].getMorph();
-      addMorph( fword, ma );
-    } 
-    else {
-      if (debugFlag)
-	*Log(mbmaLog) << "multiple lemma's" << endl;
-      map<string, int> possible_lemmas;
-      // find unique lemma's
-      for ( size_t q = 0; q < match; ++q ) {
-	const vector<string> ma = analysis[matches[q]].getMorph();
-	string key;
-	for ( size_t p=0; p < ma.size(); ++p )
-	  key += ma[p];
-	map<string, int>::iterator lemmaIt = possible_lemmas.find( key );
-	if (lemmaIt == possible_lemmas.end()){
-	  possible_lemmas.insert( make_pair( key,1 ) );
-	}
-	else {
-	  lemmaIt->second++;
-	}
-      }
-      if (debugFlag)
-	*Log(mbmaLog) << "#unique lemma's: " << possible_lemmas.size() << endl;
-      if ( possible_lemmas.size() < 1) {
-	if (debugFlag)
-	  *Log(mbmaLog) << "Problem!, no possible lemma's" << endl;
-	return;
-      }
-      // append all unique lemmas
-      // find best match
-      // loop through all subParts of the tag
-      // and match with inflections from each m
-      vector<Feature*> feats = pos->select<Feature>();
-      if (debugFlag){
-	*Log(mbmaLog) << "tag: " << tag << endl;
-	for ( size_t q =0 ; q < feats.size(); ++q ) {
-	  *Log(mbmaLog) << "\tpart #" << q << ": " << feats[q]->cls() << endl;
-	}
-      }
-      map <string, const vector<string>* > bestMatches;
-      int max_count = 0;
-      for ( size_t q=0; q < match; ++q ) {
-	int match_count = 0;
-	string inflection = analysis[matches[q]].getInflection();
-	if (debugFlag)
-	  *Log(mbmaLog) << "matching " << inflection << " with " << tag << endl;
-	for ( size_t u=0; u < feats.size(); ++u ) {
-	  map<string,string>::const_iterator conv_tag_p = TAGconv.find(feats[u]->cls());
-	  if (conv_tag_p != TAGconv.end()) {
-	    string c = conv_tag_p->second;
-	    if ( inflection.find( c ) != string::npos )
-	      match_count++;
-	  }
+    for ( size_t u=0; u < feats.size(); ++u ) {
+      map<string,string>::const_iterator conv_tag_p = TAGconv.find(feats[u]);
+      if (conv_tag_p != TAGconv.end()) {
+	string c = conv_tag_p->second;
+	if (debugFlag){
+	  *Log(mbmaLog) << "found " << feats[u] << " ==> " << c << endl;
 	}
-	if (debugFlag)
-	  *Log(mbmaLog) << "score: " << match_count << " max was " << max_count << endl;
-	if (match_count >= max_count) {
-	  string key;
-	  const vector<string> *ma = &analysis[matches[q]].getMorph();
-	  for ( size_t p=0; p < ma->size(); ++p )
-	    key += (*ma)[p] + "+"; // create uniqe keys
-	  
-	  if (match_count > max_count) {
-	    max_count = match_count;
-	    bestMatches.clear();
+	if ( inflection.find( c ) != string::npos ){
+	  if (debugFlag){
+	    *Log(mbmaLog) << "it is in the inflection " << endl;
 	  }
-	  bestMatches.insert( make_pair(key, ma ) );
+	  match_count++;
 	}
       }
-      map< string, const vector<string> *>::const_iterator it = bestMatches.begin();
-      while ( it != bestMatches.end() ){
-	if (debugFlag){
-	  string tmp;
-	  for ( size_t p=0; p < it->second->size(); ++p )
-	    tmp += "[" + (*it->second)[p] + "]";
-	  *Log(mbmaLog) << "MBMA add lemma: " << tmp << endl;
-	}
-	addMorph( fword, *it->second );
-	++it;
+    }
+    if (debugFlag)
+      *Log(mbmaLog) << "score: " << match_count << " max was " << max_count << endl;
+    if (match_count >= max_count) {
+      if (match_count > max_count) {
+	max_count = match_count;
+	bestMatches.clear();
       }
+      bestMatches.insert(&analysis[q]);
+    }
+  }
+  // so now we have "the" best matches.
+  // Weed the rest
+  vector<const MBMAana*> res;
+  set<const MBMAana*>::const_iterator bit = bestMatches.begin();
+  while ( bit != bestMatches.end() ){
+    res.push_back( *bit );
+    ++bit;
+  }
+  if (debugFlag){
+    *Log(mbmaLog) << "filter: analysis after second step" << endl;
+    int i=1;
+    for(vector<const MBMAana*>::const_iterator it=res.begin(); it != res.end(); it++)
+      *Log(mbmaLog) << i++ << " - " <<  *it << endl;
+    *Log(mbmaLog) << "start looking for doubles" << endl;
+  }
+  //
+  // but now we still might have doubles
+  //
+  map<string, const MBMAana*> unique;
+  vector<const MBMAana*>::iterator it=res.begin();
+  while (  it != res.end() ){
+    vector<string> v = (*it)->getMorph();
+    string tmp;
+    // create an unique key
+    for ( size_t p=0; p < v.size(); ++p ) {
+      tmp += v[p] + "+";
     }
+    unique[tmp] = *it;
+    ++it;
+  }
+  vector<MBMAana> result;
+  map<string, const MBMAana*>::const_iterator uit=unique.begin();
+  while ( uit != unique.end() ){
+    result.push_back( *(uit->second) );
+    ++uit;
   }
-}  // postprocess
+  analysis = result;
+  if (debugFlag){
+    *Log(mbmaLog) << "filter: definitive analysis:" << endl;
+    int i=1;
+    for(vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
+      *Log(mbmaLog) << i++ << " - " << *it << endl;
+    *Log(mbmaLog) << "done filtering" << endl;
+  }
+  return;
+}
 
+void Mbma::getFoLiAResult( Word *fword, const UnicodeString& uword ) const {
+  if ( analysis.size() == 0 ){
+    // fallback option: use the lowercased word and pretend it's a lemma ;-)
+    UnicodeString word = uword;
+    word.toLower();
+    if ( debugFlag ){
+      *Log(mbmaLog) << "no matches found, use the word instead: " 
+		    << word << endl;
+    }
+    vector<string> tmp;
+    tmp.push_back( UnicodeToUTF8(word) );
+    addMorph( fword, tmp );
+  }
+  else {
+    vector<MBMAana>::const_iterator sit = analysis.begin();
+    while( sit != analysis.end() ){
+      if ( sit == analysis.begin() )
+	addMorph( fword, sit->getMorph() );
+      else
+	addAltMorph( fword, sit->getMorph() );
+      ++sit;
+    }
+  }
+}
+  
 void Mbma::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::MORPHOLOGICAL, tagset,
 	       "annotator='frog-mbma-" +  version + 
-	       "', annotatortype='auto'");
+	       + "', annotatortype='auto', datetime='" + getTime() + "'");
 }
-  
-bool Mbma::Classify( Word* sword ){
+
+UnicodeString Mbma::filterDiacritics( const UnicodeString& in ) const {
+  if ( transliterator ){
+    UnicodeString result = in;
+    transliterator->transliterate( result );
+    return result;
+  }
+  else
+    return in;
+}
+
+void Mbma::Classify( Word* sword ){
+  if ( sword->isinstance(PlaceHolder_t) )
+    return;
   UnicodeString uWord;
   PosAnnotation *pos;
+  string head;
 #pragma omp critical(foliaupdate)
   {
     uWord = sword->text();
-    pos = sword->annotation<PosAnnotation>();
+    pos = sword->annotation<PosAnnotation>( cgn_tagset );
+    head = pos->feat("head");
   }
-  string tag = pos->feat("head");
-  if ( tag == "SPEC" || tag == "LET" ){
+  if ( head == "SPEC" || head == "LET" ){
     string word = UnicodeToUTF8( uWord );
     vector<string> tmp;
     tmp.push_back( word );
     addMorph( sword, tmp );
-    return true;
   }
+  else {
+    vector<string> featVals;
+#pragma omp critical(foliaupdate)
+    {
+      vector<folia::Feature*> feats = pos->select<folia::Feature>();
+      for ( size_t i = 0; i < feats.size(); ++i )
+	featVals.push_back( feats[i]->cls() );
+    }
+    Classify( uWord );
+    filterTag( head, featVals );
+    getFoLiAResult( sword, uWord );
+  }
+}
+
+void Mbma::Classify( const UnicodeString& word ){
+  UnicodeString uWord = word;
   uWord.toLower();
+  uWord = filterDiacritics( uWord );
   if (debugFlag)
     *Log(mbmaLog) << "Classify word: " << uWord << endl;
   
@@ -760,17 +925,34 @@ bool Mbma::Classify( Word* sword ){
   for( size_t i=0; i < insts.size(); ++i ) {
     string ans;
     MTree->Classify( insts[i], ans );
-    if ( debugFlag )
-      *Log(mbmaLog) << "itt #" << i << ": timbl gave class= " << ans << endl; 
+    if ( debugFlag ){
+      *Log(mbmaLog) << "itt #" << i << ": timbl gave class= " << ans 
+		    << ", it matched at depth=" << MTree->matchDepth() << endl; 
+    }
     classes.push_back( ans);
   }
-
+  
   // fix for 1st char class ==0
   if ( classes[0] == "0" )
     classes[0] = "X";  
   execute( uWord, classes );
-  postprocess( sword, pos );
-  return true;
+}
+
+vector<vector<string> > Mbma::getResult() const {
+  vector<vector<string> > result;
+  for (vector<MBMAana>::const_iterator it=analysis.begin(); 
+       it != analysis.end(); 
+       it++ ){
+    vector<string> mors = it->getMorph();
+    if ( debugFlag ){
+      *Log(mbmaLog) << "Morphs " << mors << endl;
+    }
+    result.push_back( mors );
+  }
+  if ( debugFlag ){
+    *Log(mbmaLog) << "result of morph analyses: " << result << endl;
+  }
+  return result;
 }
 
 ostream& operator<< ( ostream& os, const MBMAana& a ){
@@ -779,4 +961,12 @@ ostream& operator<< ( ostream& os, const MBMAana& a ){
   return os;
 }
 
+ostream& operator<< ( ostream& os, const MBMAana *a ){
+  if ( a )
+    os << *a;
+  else 
+    os << "no-mbma";
+  return os;
+}
+
 
diff --git a/src/mbma_prog.cxx b/src/mbma_prog.cxx
new file mode 100644
index 0000000..d28d89b
--- /dev/null
+++ b/src/mbma_prog.cxx
@@ -0,0 +1,222 @@
+/*
+  $Id:$
+  $URL:$
+
+  Copyright (c) 2006 - 2013
+  Tilburg University
+
+  A Morphological-Analyzer for Dutch
+ 
+  This file is part of frog
+
+  frog 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.
+
+  frog 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 <http://www.gnu.org/licenses/>.
+
+  For questions and suggestions, see:
+      http://ilk.uvt.nl/software.html
+  or send mail to:
+      timbl at uvt.nl
+*/
+
+
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <vector>
+#include <map>
+
+#include "config.h"
+#include "timbl/TimblAPI.h"
+#include "ticcutils/LogStream.h"
+#include "ticcutils/Configuration.h"
+#include "libfolia/folia.h"
+#include "frog/ucto_tokenizer_mod.h"
+#include "frog/cgn_tagger_mod.h"
+#include "frog/mbma_mod.h"
+
+using namespace std;
+using namespace Timbl;
+
+LogStream my_default_log( cerr, "", StampMessage ); // fall-back
+LogStream *theErrLog = &my_default_log;  // fill the externals
+int tpDebug = 0; //0 for none, more for more output
+
+string TestFileName;
+string ProgName;
+bool doAll = false;
+
+Configuration configuration;
+static string configDir = string(SYSCONF_PATH) + "/" + PACKAGE + "/";
+static string configFileName = configDir + "frog.cfg";
+
+static UctoTokenizer tokenizer;
+static CGNTagger tagger;
+
+void usage( ) {
+  cout << endl << "Options:\n";
+  cout << "\t============= INPUT MODE (mandatory, choose one) ========================\n"
+       << "\t -t <testfile>          Run mbma on this file\n"
+       << "\t -c <filename>    Set configuration file (default " << configFileName << ")\n"
+       << "\t============= OTHER OPTIONS ============================================\n"
+       << "\t -h. give some help.\n"
+       << "\t -V or --version .   Show version info.\n"
+       << "\t -d <debug level>    (for more verbosity)\n";
+}
+
+static Mbma myMbma;
+
+bool parse_args( TimblOpts& Opts ) {
+  string value;
+  bool mood;
+  if ( Opts.Find('V', value, mood ) ||
+       Opts.Find("version", value, mood ) ){
+    // we already did show what we wanted.
+    exit( EXIT_SUCCESS );
+  }
+  if ( Opts.Find ('h', value, mood)) {
+    usage();
+    exit( EXIT_SUCCESS );
+  };
+  // is a config file specified?
+  if ( Opts.Find( 'c',  value, mood ) ) {
+    configFileName = value;
+    Opts.Delete( 'c' );
+  };
+
+  if ( configuration.fill( configFileName ) ){
+    cerr << "config read from: " << configFileName << endl;
+  }
+  else {
+    cerr << "failed to read configuration from! '" << configFileName << "'" << endl;
+    cerr << "did you correctly install the frogdata package?" << endl;
+    return false;
+  }
+
+  // debug opts
+  if ( Opts.Find ('d', value, mood)) {
+    int debug = 0;
+    if ( !TiCC::stringTo<int>( value, debug ) ){
+      cerr << "-d value should be an integer" << endl;
+      return false;
+    }
+    configuration.setatt( "debug", value, "mbma" );
+    Opts.Delete('d');
+  };
+
+  if ( Opts.Find( 't', value, mood )) {
+    TestFileName = value;
+    ifstream is( value.c_str() );
+    if ( !is ){
+      cerr << "input stream " << value << " is not readable" << endl;
+      return false;
+    }
+    Opts.Delete('t');
+  };
+  if ( Opts.Find( 'a', value, mood )) {
+    doAll = true;
+    Opts.Delete('a');
+  };
+  return true;
+}
+
+bool init(){  
+  // for some modules init can take a long time
+  // so first make sure it will not fail on some trivialities
+  //
+  if ( !myMbma.init( configuration ) ){
+    cerr << "MBMA Initialization failed." << endl;
+    return false;
+  }
+  if ( !tokenizer.init( configuration, "", false ) ){
+    cerr << "UCTO Initialization failed." << endl;
+    return false;
+  }
+  if ( !tagger.init( configuration ) ){
+    cerr << "CGN Initialization failed." << endl;
+    return false;
+  }
+  cerr << "Initialization done." << endl;
+  return true;
+}
+
+void Test( istream& in ){
+  string line;
+  while ( getline( in, line ) ){
+    vector<string> sentences = tokenizer.tokenize( line );
+    for ( size_t s=0; s < sentences.size(); ++s ){
+      vector<TagResult> tagv = tagger.tagLine(sentences[s]);
+      for ( size_t w=0; w < tagv.size(); ++w ){
+	UnicodeString uWord = folia::UTF8ToUnicode(tagv[w].word());
+	myMbma.Classify( uWord );
+	if ( !doAll ){
+	  vector<string> v;
+	  size_t num = TiCC::split_at_first_of( tagv[w].assignedTag(), 
+						 v, "(,)" );
+	  if ( num < 1 ){
+	    throw runtime_error( "error: tag not in right format " );    
+	  }
+	  string head = v[0];
+	  v.erase(v.begin());
+	  myMbma.filterTag( head, v );
+	}
+	vector<vector<string> > res = myMbma.getResult();
+	cout << tagv[w].word() << " {" << tagv[w].assignedTag() << "}\t";
+	for ( size_t i=0; i < res.size(); ++i ){
+	  cout << res[i];
+	  if ( i < res.size()-1 )
+	    cout << "/";
+	}
+	cout << endl;
+      }
+      cout << "<utt>" << endl << endl;
+    }
+    cout << endl;
+  }
+  return;
+}
+
+
+int main(int argc, char *argv[]) {
+  std::ios_base::sync_with_stdio(false);
+  cerr << "mbma " << VERSION << " (c) ILK 1998 - 2013" << endl;
+  cerr << "Induction of Linguistic Knowledge Research Group, Tilburg University" << endl;
+  ProgName = argv[0];
+  cerr << "based on [" << Timbl::VersionName() << "]" << endl;
+  cerr << "configdir: " << configDir << endl;
+  try {
+    TimblOpts Opts(argc, argv);
+    if ( parse_args(Opts) ){
+      if (  !init() ){
+	cerr << "terminated." << endl;
+	return EXIT_FAILURE;
+      }
+      ifstream in(TestFileName.c_str() );
+      if ( in.good() ){
+	Test( in );
+      }
+      else {
+	cerr << "unable to open: " << TestFileName << endl;
+	return EXIT_FAILURE;
+      }
+    }
+    else {
+      return EXIT_FAILURE;
+    }
+  }
+  catch ( const exception& e ){
+    cerr << "fatal error: " << e.what() << endl;
+    return EXIT_FAILURE;
+  }
+  return EXIT_SUCCESS;
+}
diff --git a/src/mwu_chunker_mod.cxx b/src/mwu_chunker_mod.cxx
index 5dedd56..f98c9d0 100755
--- a/src/mwu_chunker_mod.cxx
+++ b/src/mwu_chunker_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: mwu_chunker_mod.cxx 14478 2012-03-19 16:10:38Z sloot $
+  $Id: mwu_chunker_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/mwu_chunker_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   This file is part of frog.
@@ -37,12 +37,11 @@
 #include "timbl/TimblAPI.h"
 
 #include "frog/Frog.h" // defines etc.
-#include "libfolia/folia.h" 
-#include "libfolia/document.h"
 #include "frog/mwu_chunker_mod.h"
 
-using namespace folia;
 using namespace std;
+using namespace TiCC;
+using namespace folia;
 
 mwuAna::mwuAna( Word *fwrd ){
   spec = false;
@@ -55,7 +54,7 @@ mwuAna::mwuAna( Word *fwrd ){
   if ( tag == "SPEC" ){
 #pragma omp critical(foliaupdate)
     {
-      vector<Feature*> feats = fwrd->select<Feature>();
+      vector<folia::Feature*> feats = fwrd->select<folia::Feature>( );
       spec = ( feats.size() == 1 && feats[0]->cls() == "deeleigen" );
     }
   }
@@ -144,7 +143,7 @@ bool Mwu::init( const Configuration& config ) {
   debug = tpDebug;
   string val = config.lookUp( "debug", "mwu" );
   if ( !val.empty() )
-    debug = stringTo<int>( val );
+    debug = TiCC::stringTo<int>( val );
   val = config.lookUp( "t", "mwu" );  
   if ( val.empty() ){
     *Log(mwuLog) << "cannot find attribute 't' in configfile" << endl;
@@ -167,6 +166,7 @@ bool Mwu::init( const Configuration& config ) {
   }
   else
     tagset = val;
+
   return true;
 }
 
@@ -181,20 +181,23 @@ void Mwu::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::ENTITY, 
 	       tagset,
 	       "annotator='frog-mwu-" + version
-	       + "', annotatortype='auto'");
+	       + "', annotatortype='auto', datetime='" + getTime() + "'");
 }
 
-void Mwu::Classify( Sentence *sent ){
+void Mwu::Classify( const vector<Word*>& words ){
+  if ( words.empty() )
+    return;
   reset();
-  vector<Word*> words;
-#pragma omp critical(foliaupdate)
-  {
-    words = sent->words();
+  for ( size_t i=0; i < words.size(); ++i ){
+    add( words[i] );
   }
-  for ( size_t i=0; i < words.size(); ++i )
-    add( words[i] );  
   Classify();
   EntitiesLayer *el = 0;
+  Sentence *sent;
+#pragma omp critical(foliaupdate)
+  {
+    sent = words[0]->sentence();
+  }
   for( size_t i = 0; i < mWords.size(); ++i ){
     el = mWords[i]->addEntity( tagset, sent, el );
   }
diff --git a/src/ner_tagger_mod.cxx b/src/ner_tagger_mod.cxx
index b7e3798..a9d8e95 100644
--- a/src/ner_tagger_mod.cxx
+++ b/src/ner_tagger_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: ner_tagger_mod.cxx 14481 2012-03-21 11:26:55Z sloot $
+  $Id: ner_tagger_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/ner_tagger_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -29,8 +29,6 @@
 */
 
 #include "mbt/MbtAPI.h"
-#include "libfolia/folia.h"
-#include "libfolia/document.h"
 #include "frog/Frog.h"
 #include "frog/ner_tagger_mod.h"
 
@@ -51,7 +49,7 @@ bool NERTagger::init( const Configuration& conf ){
   debug = tpDebug;
   string db = conf.lookUp( "debug", "NER" );
   if ( !db.empty() )
-    debug = folia::stringTo<int>( db );
+    debug = TiCC::stringTo<int>( db );
   switch ( debug ){
   case 0:
   case 1:
@@ -81,7 +79,12 @@ bool NERTagger::init( const Configuration& conf ){
     *Log(nerLog) << "Unable to find settings for NER" << endl;
     return false;
   }
-  string settings = val;
+  string settings;
+  if ( val[0] == '/' ) // an absolute path
+    settings = val;
+  else
+    settings =  configuration.configDir() + val;
+
   val = conf.lookUp( "version", "NER" );
   if ( val.empty() ){
     version = "1.0";
@@ -95,9 +98,9 @@ bool NERTagger::init( const Configuration& conf ){
   else
     tagset = val;
 
-  string init = "-s " + configuration.configDir() + settings + " -vcf";
+  string init = "-s " + settings + " -vcf";
   tagger = new MbtAPI( init, *nerLog );
-  return tagger != 0;
+  return tagger->isInit();
 }
 
 static void addEntity( EntitiesLayer *entities, 
@@ -126,13 +129,15 @@ static void addEntity( EntitiesLayer *entities,
   }
 }
 
-void NERTagger::addNERTags( Sentence *sent, 
-			    const vector<Word*>& words,
+void NERTagger::addNERTags( const vector<Word*>& words,
 			    const vector<string>& tags,
 			    const vector<double>& confs ){
+  if ( words.empty() )
+    return;
   EntitiesLayer *el = 0;
 #pragma omp critical(foliaupdate)
   {
+    Sentence *sent = words[0]->sentence();
     try {
       el = sent->annotation<EntitiesLayer>();
     }
@@ -152,7 +157,7 @@ void NERTagger::addNERTags( Sentence *sent,
       if ( !stack.empty() ){
 	if (debug) {
 	  *Log(nerLog) << "O spit out " << curNER << endl;
-	  using folia::operator<<;
+	  using TiCC::operator<<;
 	  *Log(nerLog) << "spit out " << stack << endl;	
 	}
 	addEntity( el, tagset, stack, dstack, curNER );
@@ -162,7 +167,7 @@ void NERTagger::addNERTags( Sentence *sent,
       continue;
     }
     else {
-      size_t num_words = Timbl::split_at( tags[i], ner, "-" );
+      size_t num_words = TiCC::split_at( tags[i], ner, "-" );
       if ( num_words != 2 ){
 	*Log(nerLog) << "expected <NER>-tag, got: " << tags[i] << endl;
 	exit( EXIT_FAILURE );
@@ -176,7 +181,7 @@ void NERTagger::addNERTags( Sentence *sent,
       if ( !stack.empty() ){
 	if ( debug ){
 	  *Log(nerLog) << "B spit out " << curNER << endl;
-	  using folia::operator<<;
+	  using TiCC::operator<<;
 	  *Log(nerLog) << "spit out " << stack << endl;	
 	}
 	addEntity( el, tagset, stack, dstack, curNER );
@@ -191,7 +196,7 @@ void NERTagger::addNERTags( Sentence *sent,
   if ( !stack.empty() ){
     if ( debug ){
       *Log(nerLog) << "END spit out " << curNER << endl;
-      using folia::operator<<;
+      using TiCC::operator<<;
       *Log(nerLog) << "spit out " << stack << endl;	
     }
     addEntity( el, tagset, stack, dstack, curNER );
@@ -202,15 +207,10 @@ void NERTagger::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::ENTITY, 
 	       tagset,
 	       "annotator='frog-ner-" + version
-	       + "', annotatortype='auto'");
+	       + "', annotatortype='auto', datetime='" + getTime() + "'");
 }
 
-void NERTagger::Classify( Sentence *sent ){
-  vector<Word*> swords;
-#pragma omp critical(foliaupdate)
-  {
-    swords = sent->words();
-  }
+void NERTagger::Classify( const vector<Word *>& swords ){
   if ( !swords.empty() ) {
     vector<string> words;
     string sentence; // the tagger needs the whole sentence
@@ -240,7 +240,7 @@ void NERTagger::Classify( Sentence *sent ){
       tags.push_back( tagv[i].assignedTag() );
       conf.push_back( tagv[i].confidence() );
     }
-    addNERTags( sent, swords, tags, conf );
+    addNERTags( swords, tags, conf );
   }
 }
 
diff --git a/src/ucto_tokenizer_mod.cxx b/src/ucto_tokenizer_mod.cxx
index d611b6c..8830137 100644
--- a/src/ucto_tokenizer_mod.cxx
+++ b/src/ucto_tokenizer_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: ucto_tokenizer_mod.cxx 14267 2012-02-15 13:05:47Z sloot $
+  $Id: ucto_tokenizer_mod.cxx 15833 2013-03-28 12:10:55Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/ucto_tokenizer_mod.cxx $
 
-  Copyright (c) 2006 - 2012
+  Copyright (c) 2006 - 2013
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
@@ -32,10 +32,11 @@
 #include <string>
 #include "timbl/TimblAPI.h"
 #include "frog/Frog.h"
-#include "frog/Configuration.h"
+#include "ticcutils/Configuration.h"
 #include "frog/ucto_tokenizer_mod.h"
 
 using namespace std;
+using namespace TiCC;
 
 UctoTokenizer::UctoTokenizer() {
   tokenizer = 0; 
@@ -47,7 +48,6 @@ bool UctoTokenizer::init( const Configuration& conf, const string & docid, bool
     throw runtime_error( "ucto tokenizer is already initalized" );
   tokenizer = new Tokenizer::TokenizerClass();
   tokenizer->setErrorLog( uctoLog );
-  *Log(uctoLog) << endl;
   string debug = conf.lookUp( "debug", "tokenizer" );
   if ( debug.empty() ){
     debug = conf.lookUp( "debug" );
@@ -56,7 +56,7 @@ bool UctoTokenizer::init( const Configuration& conf, const string & docid, bool
     tokenizer->setDebug( tpDebug );
   }
   else
-    tokenizer->setDebug( Timbl::stringTo<int>(debug) );
+    tokenizer->setDebug( TiCC::stringTo<int>(debug) );
   if ( pass ){
     // when passthru, we don't further initialize the tokenizer
     // it wil run in minimal mode then.
@@ -81,6 +81,15 @@ bool UctoTokenizer::init( const Configuration& conf, const string & docid, bool
   return true;
 }
 
+void UctoTokenizer::setUttMarker( const string& u ) {
+  if ( tokenizer ){
+    if ( !u.empty() )
+      tokenizer->setEosMarker( u ); 
+  }
+  else
+    throw runtime_error( "ucto tokenizer not initalized" );
+};
+
 void UctoTokenizer::setSentencePerLineInput( bool b ) {
   if ( tokenizer )
     tokenizer->setSentencePerLineInput( b ); 
@@ -88,6 +97,13 @@ void UctoTokenizer::setSentencePerLineInput( bool b ) {
     throw runtime_error( "ucto tokenizer not initalized" );
 };
 
+void UctoTokenizer::setQuoteDetection( bool b ) {
+  if ( tokenizer )
+    tokenizer->setQuoteDetection( b ); 
+  else
+    throw runtime_error( "ucto tokenizer not initalized" );
+};
+
 void UctoTokenizer::setInputEncoding( const std::string & enc ){
   if ( tokenizer ){
     if ( !enc.empty() )
@@ -97,6 +113,15 @@ void UctoTokenizer::setInputEncoding( const std::string & enc ){
     throw runtime_error( "ucto tokenizer not initalized" );
 }
 
+void UctoTokenizer::setTextClass( const std::string& cls ){
+  if ( tokenizer ){
+    if ( !cls.empty() )
+      tokenizer->setTextClass( cls );
+  }
+  else
+    throw runtime_error( "ucto tokenizer not initalized" );
+}
+
 void UctoTokenizer::setInputXml( bool b ){
   if ( tokenizer ){
     tokenizer->setXMLInput( b );
@@ -105,6 +130,21 @@ void UctoTokenizer::setInputXml( bool b ){
     throw runtime_error( "ucto tokenizer not initalized" );
 }
 
+vector<string> UctoTokenizer::tokenize( const string& line ){
+  if ( tokenizer ){
+    if ( tokenizer->getPassThru() ){
+      bool bos = true;
+      tokenizer->passthruLine( line, bos );
+    }
+    else {
+      tokenizer->tokenizeLine( line );
+    }
+    return tokenizer->getSentences();
+  }
+  else
+    throw runtime_error( "ucto tokenizer not initalized" );
+}
+
 folia::Document UctoTokenizer::tokenize( istream& is ){
   if ( tokenizer )
     return tokenizer->tokenize( is );
diff --git a/tests/Makefile.in b/tests/Makefile.in
index dda04c9..cb65e61 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -39,10 +39,9 @@ host_triplet = @host@
 subdir = tests
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
-	$(top_srcdir)/m4/ac_python_devel.m4 \
-	$(top_srcdir)/m4/acx_pthread.m4 \
-	$(top_srcdir)/m4/ax_icu_check.m4 $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
 	$(top_srcdir)/m4/openmp.m4 $(top_srcdir)/m4/pkg.m4 \
@@ -146,7 +145,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSCONF_PATH = @SYSCONF_PATH@
+SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -156,12 +155,12 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -208,6 +207,8 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+ticcutils_CFLAGS = @ticcutils_CFLAGS@
+ticcutils_LIBS = @ticcutils_LIBS@
 timbl_CFLAGS = @timbl_CFLAGS@
 timbl_LIBS = @timbl_LIBS@
 timblserver_CFLAGS = @timblserver_CFLAGS@
@@ -308,10 +309,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/frog.git



More information about the debian-science-commits mailing list