Skip to content

Commit

Permalink
some prefix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed Jan 21, 2025
1 parent 5cc6552 commit f810c3e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/cgspell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,32 @@ void print_cg_subreading(size_t indent, const string& form,
variant<Nothing, Weight> mw_a, const std::string& errtag) {
os << string(indent, '\t');
bool in_lemma = false;
bool in_prefixes = true;
vector<string> prefixes;
for (vector<string>::const_iterator it = beg; it != end; ++it) {
bool is_tag = is_cg_tag(*it);
if (in_lemma) {
if (is_tag) {
in_lemma = false;
os << "\"";
for (auto prefix : prefixes) {
os << " Prefix/" << prefix;
}
}
}
else {
if (!is_tag) {
in_lemma = true;
in_prefixes = false;
os << "\"";
}
}
os << (*it);
if ((in_prefixes) && (!in_lemma)) {
prefixes.push_back(*it);
}
else {
os << (*it);
}
}
if (in_lemma) {
os << "\"";
Expand Down

0 comments on commit f810c3e

Please sign in to comment.