Parsimony: duplicate environments are not flagged

Open
#154 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start by reading environment_side.canonical_key and the existing P-statement-unused Measure to understand how environments and infix Position uses are represented. Then build the Grammar-group P-env-duplicate Measure and add a seeded-defect fixture with a clean control. Done means duplicate pairs, including spacing variants, produce one group finding naming the allomorphs using each copy, while the control stays clean and the 25,000-entry check remains under one second.

Written by the indexing model from the issue text.

Description

Two environments with the same left and right sides get no Parsimony finding. A reviewer merges them; Parsimony does not see them. A 25,000-entry grammar had three duplicate pairs, two of which differ only in spacing (/ _ l against / _ l).

What we know:

  • environment_side.canonical_key (schema v9) hashes the resolved tokens of each side, so spelling differences fall away when both sides' keys are compared.
  • P-statement-unused already reads environments; it reports unused ones, not duplicates. It correctly counts an infix Position as a use.

Proposed change: a Grammar-group Measure P-env-duplicate, one group finding per set of environments whose two sides have equal canonical keys, naming every allomorph that uses each copy. Static; under 1 s at 25,000 entries.

Next: build it with a seeded-defect fixture and a clean control.

Dominant language
C#
Stars
1
Forks
0
Avg merge
3h 55m
Merged PRs (30d)
36

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sillsdev/motif

All issues in sillsdev/motif

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.