summary refs log tree commit diff stats
path: root/generator/generator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generator/generator.cpp')
-rw-r--r--generator/generator.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/generator/generator.cpp b/generator/generator.cpp index 49018c8..0639492 100644 --- a/generator/generator.cpp +++ b/generator/generator.cpp
@@ -374,6 +374,10 @@ void generator::run() {
374 for (size_t f_id2 : all_forms) { 374 for (size_t f_id2 : all_forms) {
375 if (f_id1 != f_id2) { 375 if (f_id1 != f_id2) {
376 Form& form = forms_.at(f_id1); 376 Form& form = forms_.at(f_id1);
377 Form& form2 = forms_.at(f_id2);
378 if (form.anagram_set_id == form2.anagram_set_id) {
379 continue;
380 }
377 form.puzzles[kYellowTop].insert(f_id2); 381 form.puzzles[kYellowTop].insert(f_id2);
378 } 382 }
379 } 383 }
@@ -427,6 +431,9 @@ void generator::run() {
427 for (size_t f_id1 : pronunciation.form_ids) { 431 for (size_t f_id1 : pronunciation.form_ids) {
428 for (size_t f_id2 : all_forms) { 432 for (size_t f_id2 : all_forms) {
429 Form& form = forms_.at(f_id1); 433 Form& form = forms_.at(f_id1);
434 if (form.reverse_form_id == f_id2) {
435 continue;
436 }
430 form.puzzles[kBlackTop].insert(f_id2); 437 form.puzzles[kBlackTop].insert(f_id2);
431 } 438 }
432 } 439 }
@@ -573,6 +580,12 @@ void generator::run() {
573 for (size_t mero_form_id : merophone.form_ids) { 580 for (size_t mero_form_id : merophone.form_ids) {
574 Form& mero_form = forms_.at(mero_form_id); 581 Form& mero_form = forms_.at(mero_form_id);
575 582
583 if (holo_form.text.find(mero_form.text) !=
584 std::string::npos) {
585 // We don't want top puzzles that are also middle puzzles.
586 continue;
587 }
588
576 bool word_overlap = false; 589 bool word_overlap = false;
577 for (size_t holo_word_id : holo_form.word_ids) { 590 for (size_t holo_word_id : holo_form.word_ids) {
578 for (size_t mero_word_id : mero_form.word_ids) { 591 for (size_t mero_word_id : mero_form.word_ids) {