Cleaning up a messy word list before you import it

If an import came out wrong, the cause is almost always one of five things in the file: mixed separators, a header row, line numbering, trailing punctuation, or definitions containing the separator character. All five are a find-and-replace away, and it is worth doing before the import rather than editing entries afterwards.

1. Mixed separators

This is the big one. Paira picks a single separator for the whole file — the one that successfully splits the most lines — so if two hundred lines use tabs and forty use commas, the forty lose and get reported as skipped.

Files get mixed like this when they are assembled from two sources, or when someone edited a few rows by hand. Search for each candidate separator in turn and see which lines light up. Then convert the minority to match the majority.

2. A header row

A first line reading "Term, Definition" is a valid two-column line as far as any parser is concerned, so it imports as a word whose term is "Term". Delete it. Paira does not need a header and does not look for one.

3. Line numbering

Lists copied out of a document often arrive numbered: "1. ephemeral - geçici". The number becomes part of the term, so you end up studying "1. ephemeral", which will never match what you type.

Strip leading numbers with a find-and-replace on the pattern of digits followed by a full stop and a space. Most editors will do this with a regular expression; if yours will not, sorting the file will at least group the numbered lines together so you can fix them in one block.

4. Trailing punctuation and stray spaces

Semicolons at the end of every line, trailing commas, and double spaces around the separator all end up inside the term or the definition. Paira trims whitespace around each field, so ordinary spacing is safe, but it does not remove punctuation, because punctuation can be part of a legitimate entry.

A definition of "geçici;" and a typed answer of "geçici" are different strings. The typo tolerance will not rescue this one, so clean the punctuation out first.

5. Definitions containing the separator

On a comma-separated file, a definition like "to abandon, to give up" splits at the first comma, and everything after it becomes a third column. If most of your lines do that, Paira will decide the file has three columns and start treating the second half of your definitions as example sentences.

Switching the file to tabs solves this outright, because a tab does not appear inside definitions. It is the single highest-value change you can make to a word list.

Check the skipped count

After parsing, Paira reports how many non-empty lines it could not read. Treat that number as the test: zero means the file was clean, and anything else means one of the five problems above is still in there. Blank lines are removed before counting, so double-spaced files do not inflate it.