PhonologicalCorpusTools / CorpusTools

Phonological CorpusTools
http://phonologicalcorpustools.github.io/CorpusTools/
GNU General Public License v3.0
111 stars 16 forks source link

[BUG] Unwanted mergers #791

Closed stannam closed 2 years ago

stannam commented 2 years ago

Describe the bug After loading a corpus, the user cannot edit an existing word to have the same spelling and transcription as an existing word. PCT only adds up the frequency to the existing word.

Sample corpus file 'Example' corpus

To Reproduce Steps to reproduce the behavior:

  1. Load 'Example'
  2. Right click on 'nata' and then edit the word as shown below -- same transcription and spelling as 'mata.'

image

  1. See error

Expected behavior Ask the user before doing anything.

image

Additional context (... should have noticed when working on #717 😂)

stannam commented 2 years ago

Problem: once 'separate entry' then

solution (long run): - always add / edit as separate entry - add new function 'merge words' with more than one words selected.

stannam commented 2 years ago

close?

kchall commented 2 years ago

Maybe we should just change the warning message to specify that if frequency is added, it is added to the first entry if there are duplicates? And also add an explicit 'cancel' button? Thus:

Your input 'xx' already exists in the corpus. You can add it as a separate entry, or simply add frequency to the existing entry. If there are multiple instances of 'xx' already in the corpus, the frequency will be added to the first such entry. [Add as a separate entry] [Add frequency to existing word] [Cancel]

stannam commented 2 years ago

Tested on 'example' corpus. 'ta' already exists so creating 'ta' [tɑ] prompts the message as left. Editing 'mata' to be identical to 'nata' (in both spelling and transcription) prompts the message as right. All three buttons work as intended :) image

kchall commented 2 years ago

Looks good, thanks!