pycrossword
User Guide
×
Menu tab
Index tab

3.9.2.1. Database sources

 
As mentioned in Word source types, database sources are generally the most efficient, especially when handling large word lists. The easiest way to obtain database word sources is to import words from public spellchecker dictionaries (as discussed further in Section 3.9.7).
 
To add a new database word source, press the button in the Source Manager Toolbar and select Database in the Source Type box of the Source Editor window, as shown in Fig. 3.9.2.2. The Editor windows for the Database type look as shown in the Figure below:
 
3.9.2.1. Database sources
Fig. 3.9.2.1.1. Configuring a database word source
1

Word source name

1. Word source name
Type a name for this word source, e.g. "Russian1"
2

Selected word source type

2. Selected word source type
The controls below this box are specific to the Database source type.
3

Database file path

3. Database file path
Enter the full path to the database (*.db file for SQLite databases) or a short language name, e.g. "ru", "en" or "it".
If a database with that name exists in your pycross/assets/dic directory, the short name will be expanded internally into a fully qualified path,
e.g. ru --> pycross/assets/dic/ru.db
4

Database engine

4. Database engine
Currently, only SQLite databases are supported.
5

Database user name

5. Database user name
DB user name, if required. The inbuilt databases use none, so leave empty in most cases.
6

Database password

6. Database password
DB password, if required. The inbuilt databases use none, so leave empty in most cases.
7

Table and field names

7. Table and field names
You may want to edit the database table / field names in this field if you don't use the default schema. The schema is in JSON format. It represents the two DB tables (words and pos) and their names as well as field names as sub-elements. The part-of-speech table (pos) is not obligatory (for example, your custom database may not have part-of-speech data); so you might delete the entire second pos element with its children, as well as the fpos field in words.
 
Please note that the words table and its first three elements (table - the words table name, fid - the primary ID field name, and fwords - the name of the field containing words) are obligatory and cannot be removed.
8

Shuffle

8. Shuffle
With this option activated (by default), database results will be shuffled randomly during crossword generation, so as not to follow the default order of the word list (likely, alphabetical on the words field). When unchecked, the results will always reflect the default database table ordering.
9

Edit

9. Edit
You may edit your database in an external editor (such as DB Browser for SQLite) if it is set in Options > Plugins > Third-party > SQLite Editor. The inactive button indicates that an external editor is not assigned. However, as you will see next, you won't need an external DB editor to edit your own SQLite databases.
 
submit to reddit
Made with help of Dr.Explain