diff --git a/src/GrammarApplicator.cpp b/src/GrammarApplicator.cpp index 3455245e..83947691 100644 --- a/src/GrammarApplicator.cpp +++ b/src/GrammarApplicator.cpp @@ -439,7 +439,7 @@ void GrammarApplicator::printReading(const Reading* reading, std::ostream& outpu } } - if (reading->parent->type & CT_RELATED) { + if (print_ids || reading->parent->type & CT_RELATED) { u_fprintf(output, " ID:%u", reading->parent->global_number); if (!reading->parent->relations.empty()) { for (const auto& miter : reading->parent->relations) { diff --git a/src/GrammarApplicator.hpp b/src/GrammarApplicator.hpp index 87741afd..7937238e 100644 --- a/src/GrammarApplicator.hpp +++ b/src/GrammarApplicator.hpp @@ -123,6 +123,7 @@ class GrammarApplicator { bool split_mappings = false; bool pipe_deleted = false; bool add_spacing = true; + bool print_ids = false; bool dep_has_spanned = false; uint32_t dep_delimit = 0; diff --git a/src/main.cpp b/src/main.cpp index 28c2b735..c894dd46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -531,6 +531,9 @@ void GAppSetOpts(GrammarApplicator& applicator, UConverter* conv) { } std::cerr << "Debug level set to " << applicator.debug_level << std::endl; } + if (options[PRINT_IDS].doesOccur) { + applicator.print_ids = true; + } if (options[NUM_WINDOWS].doesOccur) { applicator.num_windows = std::stoul(options[NUM_WINDOWS].value); } diff --git a/src/options.hpp b/src/options.hpp index 85615454..a03fc7c8 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -69,6 +69,7 @@ enum OPTIONS { MAPPING_PREFIX, UNICODE_TAGS, UNIQUE_TAGS, + PRINT_IDS, NUM_WINDOWS, ALWAYS_SPAN, SOFT_LIMIT, @@ -143,6 +144,7 @@ std::array options{ UOption{"prefix", 'p', UOPT_REQUIRES_ARG, "sets the mapping prefix; defaults to @"}, UOption{"unicode-tags", 0, UOPT_NO_ARG, "outputs Unicode code points for things like ->"}, UOption{"unique-tags", 0, UOPT_NO_ARG, "outputs unique tags only once per reading"}, + UOption{"print-ids", 0, UOPT_NO_ARG, "always output IDs"}, UOption{"num-windows", 0, UOPT_REQUIRES_ARG, "number of windows to keep in before/ahead buffers; defaults to 2"}, UOption{"always-span", 0, UOPT_NO_ARG, "forces scanning tests to always span across window boundaries"},