daniel-lerch / vocup

Vocabulary trainer.
https://www.microsoft.com/store/apps/9N6W2H3QJQMM
GNU Affero General Public License v3.0
9 stars 3 forks source link

Enhanced CSV importer #25

Open Schafwolle opened 3 years ago

Schafwolle commented 3 years ago

Hy This is my first github issue so be gentle with me. I would like to migrate from another software (I don't know if I am allowed to name this software) because the other software stopped working. I know you already support a csv import but the csv support right does not support to import of the state or the date of creation.

The software supports a csv export with the following scheme:

<First Language (Mother)> ; <Second Language>; <Language name>; <Additional Information>;  <Empty or swapped> ;< Phase (State)>;  <Date of Creation>; <Date of next check>; 

swapped means that both directions are ask

A example entry

"..., nicht wahr? (Frageanhängsel)";¿verdad?;Spanisch;Buch A1 bis Lektion.7;;6;2015-01-17;;
...(oder) nicht? (Frageanhängsel);¿no?;Spanisch;Buch A1 bis Lektion.7;;6;2015-01-17;;
(stammen) sind ursprünglich aus;ser originario/a de;Spanisch;Buch B1;;5;2019-11-14;2021-02-20

I am a programmer myself, therefore I would try to write an importer. I know it is not possible to do a one2one mapping but at least I can try I know my codebase will probably not be of a good quality, but once I am done would you like a pull request. I guess will not find time to start with the importer before 2021.

Are you planing to improve the csv import? E.g: It would be possible to request a map file form the user. To support mapping from different columens to different entries in the database.

If I did something wrong regarding the issue policy of github. Please tell me.

I wish you a good new year and hopefully I will succed writting the importer.

daniel-lerch commented 3 years ago

Great first issue!

The easiest way to get all your words into Vocup would probably be to open the CSV file with Excel, remove all columns except the first two, save as CSV again and finally import it in Vocup.

Improving CSV import features has been on my to-do list for a long time already but the only new feature since Vocup 1.5.0 is the second import option for ANSI encoded files which was just a quick fix. A good CSV import would need a preview window so that it's obvious whether the user's settings will work or not. A custom mapping without a preview just with a file would be obscure for most users and not intuitive at all.

One reason why I haven't started working on a better CSV import is that I'm working on a complete rewrite of Vocup with Avalonia in the avalonia branch to replace the old Windows Forms version. This change will enable Vocup to run natively on macOS and Linux and will come with a completely new file format which will be able to store much more details for every vocabulary word.

I think it would make the most sense to implement a new CSV importer directly for the new codebase. It would be a great help if you could contribute to this and - in case you are interested - some other features. Pull request are proposals which will be discussed and don't have to be perfect when they're opened 😉

Schafwolle commented 3 years ago

Hy, Sorry for my late answer. I have used your suggestion, to only use the first two columns. I used Excel to drop all words, that have already been in the last phase (state), this reduced the words from ~5000 to ~500, which is less enough for my mother to start again from scratch. I guess this should work for now.

I have looked through the current documentation about the save file format and noticed that it is probably not so easy to add the dropped columns right now as most of the columns are not supported by vocup.

In other words I guess you are right, it is probably better to first enhance the file format for vocabularies.

I am using this project to get a little bit more used to git as I have worked with SVN so far and soon need to work with git. If you have any suggestions I can look into instead of the CSV importer let me know and I will try to solve your Issue and to learn git and GitHub on the way 😉

daniel-lerch commented 3 years ago

The new file format for Vocup 2.0 is defined here. When I saw your CSV example, I was wondering whether it would make sense to add a field like comment to the vocabulary word, for explanations, example sentences, etc. what do you think?

Schafwolle commented 3 years ago

In the program the CSV was exported from the comment was mainly used to group vocabularies further.

I guess it should not make to may troubles and work to add a addition comment string to each word and a comment column to the listview. This would allow the user to sort vocabularies by the comment. (e.g.: repeat all vocabularies of the last two chapters important for the test tomorrow)