Skip to content

Commit

Permalink
Re-merge of configuration branch into main branch [277,497].
Browse files Browse the repository at this point in the history
git-svn-id: https://pet.opendfki.de/repos/pet/main@498 4200e16c-5112-0410-ac55-d7fb557a720a
  • Loading branch information
beki01 committed Oct 20, 2008
1 parent a37dbc2 commit dd90b7c
Show file tree
Hide file tree
Showing 100 changed files with 4,637 additions and 2,398 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
v0.99.??
- remerge of configuration branch
- crash when disabling rule filter fixed (morph.cpp)
- clean up of settings file name handling
- printing of most data structures now uses C++ streams
- more harmonization with chart-mapping branch:
* added dag_nth_element()
* implemented fs::fs(char *path, type_t type)
Expand Down
57 changes: 51 additions & 6 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
+- make << operator for tItemPrinters to allow modifier stream like usage
- check if making the stream an argument of the print function decreases
performance, if not, remove the global pointer to the stream used and
replace it with a method argument

- options to set/configure printers for items/dags/chart

- implement timelimit with signal-based alarm and check the intended
functionality (real time?, cpu time?)

- do a uniform treatment of all the resource limits

- More generally: which parts of the processing should be affected by the given
limits, especially since we ge a new preprocessing component which may be
computationally expensive

- make all _fix_me_'s \todos (so that they are handled by doxygen) and try to
settle as many of them as possible

- code/modules that might go away:
- unconditional (exhaustive) unpacking
- CHIC printing (flop)
- extdict??

+- finish proper distribution/handling of options, still missing:
- `sections' to group the options, e.g., for GUI
- default values for when they are set with command line options, but
without value, like, e.g., opt_packing
- recode options.cpp such that it makes better use of the nice new
functionality, requires renaming of the options
- integrate management of settings files into the config system and get rid
of the old settings, this needs more elaborate values (maps and such)
- is there a way of turning the run-time type errors, at least for the
static code, into compile-time or link-time errors?
1. transform the string keys into #define symbols. That at least prevents
the use of unknown keys (requires proper include file use, which isn't
such a bad idea anyway). That does not resolve the problem of
key<->type correlation errors.

-! fix the problem with multiple coreferences in one TDL conjunction in flop

- check if the dumping of cyclic structures works correctly in flop

- proper handling of upcase/lowercase handling in a) tokenizers and b) lexicon
Expand All @@ -10,8 +51,6 @@
introduced that controls if conversion to lower case is done at all.
(ticket #5) (The Ueber- bzw. Aegypten bug)

- reasonable splitting of logging and output, ESSENTIAL FOR API IMPLEMENTATION!

- unpacking of edges does not terminate in some cases with unary rules
fix: separate the local unary edges and do a fix point computation. This must
terminate for correct grammars
Expand All @@ -26,7 +65,7 @@
- foreign character encoding input and output
- automated tests for single modules ??

- finish lexdb: lexical database (postgres) integration
- finish lexdb: lexical database (sqlite instead of postgres?) integration

- unreleased memory? (see valgrind-errors-15-apr-04)
Memory leak seems to be not ignoreable (berthold et al. Jan 2006)
Expand All @@ -40,8 +79,6 @@
used for unification and mark it with a special value. After some
thinking, i would say that this might not be feasible.

- 64bit version does not work properly

- remove all uses of negative values as `marker'-values, especially where casts
from integers to pointers and back are involved.

Expand Down Expand Up @@ -197,4 +234,12 @@ refactoring:
represented by its type and no features, or all appropriate features are
present. THOUGHT ABOUT THIS AND I DON'T THINK IT WILL WORK. Would require
quite complicated refilling using appropriate type fs's

+ reasonable splitting of logging and output, ESSENTIAL FOR API IMPLEMENTATION!
+- 64bit version does not work properly (current tests suggest that this seems
to be fixed)
+ all functionality for quick checks (opt_nqc...) into one place (fs.cpp/.h)
+ parsing of properties file for simple (built-in) logging
+ checked: config cheap does the same thing as main cheap. There seems to be a
reordering of tasks, which is why packed parses report different number of
passive items and parses that hit the limits report different numbers of
tasks and items
2 changes: 1 addition & 1 deletion borland/l2lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

/* Revision History:
01/10/05 UC created
01/10/05 UC created
*/

// Error conditions are communicated to the caller by throwing an exception
Expand Down
2 changes: 2 additions & 0 deletions cheap/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ libcheap_a_SOURCES = \
yy-tokenizer.cpp yy-tokenizer.h \
$(top_srcdir)/common/bitcode.cpp \
$(top_srcdir)/common/chunk-alloc.cpp \
$(top_srcdir)/common/configs.cpp \
$(top_srcdir)/common/dag-alloc.cpp \
$(top_srcdir)/common/dag-arced.cpp \
$(top_srcdir)/common/dag-common.cpp \
Expand All @@ -92,6 +93,7 @@ libcheap_a_SOURCES = \
$(top_srcdir)/common/hash.cpp \
$(top_srcdir)/common/lex-io.cpp \
$(top_srcdir)/common/lex-tdl.cpp \
$(top_srcdir)/common/logging.cpp \
$(top_srcdir)/common/mfile.c \
$(top_srcdir)/common/settings.cpp \
$(top_srcdir)/common/types.cpp \
Expand Down
17 changes: 11 additions & 6 deletions cheap/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
#include "tsdb++.h"
#include "item-printer.h"
#include "hashing.h"

#include "options.h" // for verbosity
#include <ostream>

using namespace std;
using namespace HASH_SPACE;

//#define DEBUG
//#define PETDEBUG

chart::chart(int len, auto_ptr<item_owner> owner)
: _Chart(), _trees(), _readings(), _pedges(0),
Expand All @@ -51,7 +51,7 @@ chart::~chart()

void chart::add(tItem *it)
{
#ifdef DEBUG
#ifdef PETDEBUG
it->print(DEBUGLOGGER); DEBUGLOGGER << endl;
#endif

Expand Down Expand Up @@ -89,7 +89,7 @@ void chart::remove(hash_set<tItem *> &to_delete)
, _Chart.end());
for(hash_set<tItem *>::const_iterator hit = to_delete.begin()
; hit != to_delete.end(); hit++) {
#ifdef DEBUG
#ifdef PETDEBUG
it->print(DEBUGLOGGER); DEBUGLOGGER << "removed " << endl;
#endif

Expand All @@ -112,15 +112,15 @@ void chart::remove(hash_set<tItem *> &to_delete)
}

void chart::print(std::ostream &out, tAbstractItemPrinter *pr,
bool passives, bool actives) {
bool passives, bool actives) const {
tItemPrinter def_print(out, verbosity > 2, verbosity > 10);
if (pr == NULL) {
pr = &def_print;
}
for(chart_iter pos(this); pos.valid(); pos++) {
tItem *curr = pos.current();
if ((curr->passive() && passives) || (! curr->passive() && actives)) {
pr->print(curr); out << endl;
pr->print(curr);// out << endl;
}
}
}
Expand Down Expand Up @@ -212,3 +212,8 @@ chart::connected(item_predicate &valid) {
}
return reached[rightmost()];
}

std::ostream &operator<<(std::ostream &out, const chart &ch) {
ch.print(out);
return out;
}
11 changes: 6 additions & 5 deletions cheap/chart.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class chart {
* passive items with \a passives and \a actives.
*/
void print(std::ostream &out, tAbstractItemPrinter *aip = NULL,
bool passives = true, bool actives = true);
bool passives = true, bool actives = true) const;

/** Get statistics from the chart, like nr. of active/passive edges, average
* feature structure size, items contributing to a reading etc.
Expand Down Expand Up @@ -123,6 +123,7 @@ class chart {
friend class chart_iter_adj_passive;
};

std::ostream &operator<<(std::ostream &out, const chart &ch) ;

/** Return all items from the chart.
* \attention iterators must return items in order of `stamp', so the
Expand All @@ -131,12 +132,12 @@ class chart {
class chart_iter {
public:
/** Create a new iterator for \a C */
inline chart_iter(chart *C) : _LI(C->_Chart) {
inline chart_iter(const chart *C) : _LI(C->_Chart) {
_curr = _LI.begin();
}

/** Create a new iterator for \a C */
inline chart_iter(chart &C) : _LI(C._Chart) {
inline chart_iter(const chart &C) : _LI(C._Chart) {
_curr = _LI.begin();
}

Expand All @@ -162,8 +163,8 @@ class chart_iter {
private:
friend class chart;

std::vector<class tItem *> &_LI;
std::vector<class tItem *>::iterator _curr;
const std::vector<class tItem *> &_LI;
std::vector<class tItem *>::const_iterator _curr;
};

/** Return all passive items having a specified span.
Expand Down
Loading

0 comments on commit dd90b7c

Please sign in to comment.