Skip to content

Commit

Permalink
Print wblank for other formats
Browse files Browse the repository at this point in the history
  • Loading branch information
TinoDidriksen committed Apr 30, 2024
1 parent b298b80 commit 4adb430
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/FSTApplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ void FSTApplicator::printCohort(Cohort* cohort, std::ostream& output, bool profi
goto removed;
}

if (!cohort->wblank.empty()) {
u_fprintf(output, "%S", cohort->wblank.data());
if (!ISNL(cohort->wblank.back())) {
u_fputc('\n', output);
}
}

if (cohort->wread && !did_warn_statictags) {
u_fprintf(ux_stderr, "Warning: FST CG format cannot output static tags! You are losing information!\n");
u_fflush(ux_stderr);
Expand Down
7 changes: 7 additions & 0 deletions src/GrammarApplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,13 @@ void GrammarApplicator::printCohort(Cohort* cohort, std::ostream& output, bool p
u_fprintf(output, "# RULE TARGET BEGIN\n");
}

if (!cohort->wblank.empty()) {
u_fprintf(output, "%S", cohort->wblank.data());
if (!ISNL(cohort->wblank.back())) {
u_fputc('\n', output);
}
}

if (cohort->type & CT_REMOVED) {
if (!trace || trace_no_removed) {
goto removed;
Expand Down
7 changes: 7 additions & 0 deletions src/NicelineApplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ void NicelineApplicator::printCohort(Cohort* cohort, std::ostream& output, bool
goto removed;
}

if (!cohort->wblank.empty()) {
u_fprintf(output, "%S", cohort->wblank.data());
if (!ISNL(cohort->wblank.back())) {
u_fputc('\n', output);
}
}

u_fprintf(output, "%.*S", cohort->wordform->tag.size() - 4, cohort->wordform->tag.data() + 2);
if (cohort->wread && !did_warn_statictags) {
u_fprintf(ux_stderr, "Warning: Niceline CG format cannot output static tags! You are losing information!\n");
Expand Down
2 changes: 1 addition & 1 deletion src/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ constexpr auto CG3_COPYRIGHT_STRING = "Copyright (C) 2007-2023 GrammarSoft ApS.

constexpr uint32_t CG3_VERSION_MAJOR = 1;
constexpr uint32_t CG3_VERSION_MINOR = 4;
constexpr uint32_t CG3_VERSION_PATCH = 10;
constexpr uint32_t CG3_VERSION_PATCH = 11;
constexpr uint32_t CG3_REVISION = 13898;
constexpr uint32_t CG3_FEATURE_REV = 13898;
constexpr uint32_t CG3_TOO_OLD = 10373;
Expand Down

0 comments on commit 4adb430

Please sign in to comment.