Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read SQLite: ABC Medical Notes and Almaany.com #267

Closed
sobaee opened this issue Nov 21, 2020 · 11 comments
Closed

Read SQLite: ABC Medical Notes and Almaany.com #267

sobaee opened this issue Nov 21, 2020 · 11 comments
Labels

Comments

@sobaee
Copy link

sobaee commented Nov 21, 2020

Hello
This extension is used usually by free dictionaries android applications, it would be great to have this files converted to slob for example to be able to use them all in one multidictionary viewer app.

This file is an example:
https://drive.google.com/file/d/1KeXBXxPjOYl2p2H58Xfwpow4ri4TEnrB/view?usp=drivesdk

@ilius
Copy link
Owner

ilius commented Nov 21, 2020

Those are SQLite files, but different applications use different schemas (structure of SQLite database).
So they are not one format.
Each one is probably a new format, requiring a new plugin.

What application is this file for?

@sobaee
Copy link
Author

sobaee commented Nov 22, 2020

What application is this file for?

This one in google play:
https://play.google.com/store/apps/details?id=com.pocketmednotes2014.secondapp

ilius added a commit that referenced this issue Nov 22, 2020
@ilius
Copy link
Owner

ilius commented Nov 22, 2020

I added a new format named ABCMedicalNotes

@ilius ilius changed the title Read .db files Read .db file (ABC Medical Notes 2020) Nov 22, 2020
@ilius ilius closed this as completed Nov 22, 2020
@sobaee
Copy link
Author

sobaee commented Nov 22, 2020

Great 🥳
Thanks a lot
Also, I think I could use this plugin as a template to be modified when I want to convert another database,

Could you learn me what are the lines that one can change to be able to convert other databases, please?

Esp. if it's a dictionary with many alternative entries like this one:
https://drive.google.com/file/d/1L4tjTl7Y8vy68oESTZtqrbP84r3hENy-/view?usp=drivesdk

Google play link:
https://play.google.com/store/apps/details?id=com.almaany.arar

@ilius
Copy link
Owner

ilius commented Nov 22, 2020

First you need to open the file with a SQLite Viewer / Browser / Editor, to see the table name(s), column names, and their contents.
There are many apps in Google Play if you search, but I haven't tested any of them.
You can start with testing them.

If there are alternates, or multiple rows for a single entry, etc, then you probably need to know Python programming.

ilius added a commit that referenced this issue Nov 22, 2020
@ilius
Copy link
Owner

ilius commented Nov 22, 2020

I added a plugin for it.
In this the alternate was in the same table, so it was easy.
But there are usually other details, for example here the | sign need to be replaced with newline.
You can run diff between two plugins to see what's different.

@sobaee
Copy link
Author

sobaee commented Nov 22, 2020

I added a plugin for it.
In this the alternate was in the same table, so it was easy.
But there are usually other details, for example here the | sign need to be replaced with newline.
You can run diff between two plugins to see what's different.

I didn't see this replay

Many thanks @ilius 😊

@sobaee
Copy link
Author

sobaee commented Nov 22, 2020

Just one more question please:
When I tried to convert this file (with .db), pyglossary said "unkown format"
In the previous plugin I edit the plugin and added ".db" in extension, and converted it.
Is there another way to convert it without editing the plugin?

ilius added a commit that referenced this issue Nov 22, 2020
@ilius
Copy link
Owner

ilius commented Nov 22, 2020

Okay so there are alternates in Keys table that are not WordsTable.
But there is no index for wordkey in Keys table which makes it tricky.
Luckily, the database is small enough to fit in memory.
So we can just load the entire Keys table in memory, to a Python dict, to lookup in the loop over WordsTable.
Here, I updated the plugin.

@ilius
Copy link
Owner

ilius commented Nov 22, 2020

You can convert by giving --read-format Almaany argument instead.
Also try interactive command line interface, as I explained in README.

Because there are so many .db formats, I won't make one of them special by giving .db extension in plugin.

@sobaee
Copy link
Author

sobaee commented Nov 24, 2020

Many thanks 👍

@ilius ilius removed their assignment Nov 24, 2020
@ilius ilius changed the title Read .db file (ABC Medical Notes 2020) Read SQLite: ABC Medical Notes and Almaany.com Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants