Skip to content

Commit

Permalink
format all markdown files with markdownfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Nov 19, 2024
1 parent 55e9646 commit 9fcceac
Show file tree
Hide file tree
Showing 81 changed files with 2,035 additions and 1,945 deletions.
19 changes: 6 additions & 13 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
______________________________________________________________________
---

name: Feature request
about: Suggest/request a feature (new format, option, parameter etc)
title: ''
labels:
name: Feature request about: Suggest/request a feature (new format, option, parameter etc) title: '' labels:

______________________________________________________________________
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe the solution you'd like** A clear and concise description of what you want to happen.

**Provide links and sample file(s)**
Provide links to the official website and/or download page of the related software or format.
Provide sample file(s) for the format/feature you want to be supported. Attach the file(s) if you can. If no sample file is publicly downloadable due to copyright, please mention and explain.
**Provide links and sample file(s)** Provide links to the official website and/or download page of the related software or format. Provide sample file(s) for the format/feature you want to be supported. Attach the file(s) if you can. If no sample file is publicly downloadable due to copyright, please mention and explain.
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The PyGlossary code of conduct is derived from [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct/).

- Participants will be tolerant of opposing views.
- Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
- When interpreting the words and actions of others, participants should always assume good intentions.
- Behavior that can be reasonably considered harassment will not be tolerated.
- Participants will be tolerant of opposing views.
- Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
- When interpreting the words and actions of others, participants should always assume good intentions.
- Behavior that can be reasonably considered harassment will not be tolerated.
383 changes: 182 additions & 201 deletions README.md

Large diffs are not rendered by default.

36 changes: 13 additions & 23 deletions doc/apple.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
### Required Python libraries for AppleDict

- **Reading from AppleDict Binary (.dictionary)**
- **Reading from AppleDict Binary (.dictionary)**

`sudo pip3 install lxml`
`sudo pip3 install lxml`

- **Writing to AppleDict**
- **Writing to AppleDict**

`sudo pip3 install lxml beautifulsoup4 html5lib`
`sudo pip3 install lxml beautifulsoup4 html5lib`

### Requirements for AppleDict on Mac OS X

If you want to convert glossaries into AppleDict format on Mac OS X,
you also need:
If you want to convert glossaries into AppleDict format on Mac OS X, you also need:

- GNU make as part of [Command Line Tools for
Xcode](http://developer.apple.com/downloads).
- Dictionary Development Kit as part of [Additional Tools for
Xcode](http://developer.apple.com/downloads). Extract to
`/Applications/Utilities/Dictionary Development Kit`
- GNU make as part of [Command Line Tools for Xcode](http://developer.apple.com/downloads).
- Dictionary Development Kit as part of [Additional Tools for Xcode](http://developer.apple.com/downloads). Extract to`/Applications/Utilities/Dictionary Development Kit`

### Convert Babylon (bgl) to Mac OS X dictionary

Let's assume the Babylon dict is at
`~/Documents/Duden_Synonym/Duden_Synonym.BGL`:
Let's assume the Babylon dict is at `~/Documents/Duden_Synonym/Duden_Synonym.BGL`:

```sh
cd ~/Documents/Duden_Synonym/
Expand All @@ -36,8 +31,7 @@ Launch Dictionary.app and test.

### Convert Octopus Mdict to Mac OS X dictionary

Let's assume the MDict dict is at
`~/Documents/Duden-Oxford/Duden-Oxford DEED ver.20110408.mdx`.
Let's assume the MDict dict is at `~/Documents/Duden-Oxford/Duden-Oxford DEED ver.20110408.mdx`.

Run the following command:

Expand All @@ -51,8 +45,7 @@ make install

Launch Dictionary.app and test.

Let's assume the MDict dict is at `~/Downloads/oald8/oald8.mdx`, along
with the image/audio resources file `oald8.mdd`.
Let's assume the MDict dict is at `~/Downloads/oald8/oald8.mdx`, along with the image/audio resources file `oald8.mdd`.

Run the following commands: :

Expand All @@ -62,23 +55,20 @@ python3 ~/Software/pyglossary/main.py --write-format=AppleDict oald8.mdx oald8-a
cd oald8-apple
```

This extracts dictionary into `oald8.xml` and data resources into folder
`OtherResources`. Hyperlinks use relative path. :
This extracts dictionary into `oald8.xml` and data resources into folder `OtherResources`. Hyperlinks use relative path. :

```sh
sed -i "" 's:src="/:src=":g' oald8.xml
```

Convert audio file from SPX format to WAV format. You need package
`speex` from [MacPorts](https://www.macports.org) :
Convert audio file from SPX format to WAV format. You need package `speex` from [MacPorts](https://www.macports.org) :

```sh
find OtherResources -name "*.spx" -execdir sh -c 'spx={};speexdec $spx ${spx%.*}.wav' \;
sed -i "" 's|sound://\([/_a-zA-Z0-9]*\).spx|\1.wav|g' oald8.xml
```

But be warned that the decoded WAVE audio can consume ~5 times more disk
space!
But be warned that the decoded WAVE audio can consume ~5 times more disk space!

Compile and install. :

Expand Down
36 changes: 18 additions & 18 deletions doc/babylon/bgl_info.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
## bgl_numEntries (0x0c)
bgl_numEntries (0x0c)
---------------------

`bgl_numEntries` does not always matches the number of entries in the dictionary, but it's close to it.
The difference is usually +-1 or 2, in rare cases may be 9, 29 and more.
`bgl_numEntries` does not always matches the number of entries in the dictionary, but it's close to it. The difference is usually +-1 or 2, in rare cases may be 9, 29 and more.

## bgl_length (0x43)
bgl_length (0x43)
-----------------

The length of the substring match in a term.
For example, if your glossary contains the term "Dog" and the substring length is 2,
search of the substrings "Do" or "og" will retrieve the term dog.
Use substring length 0 for exact match.
The length of the substring match in a term. For example, if your glossary contains the term "Dog" and the substring length is 2, search of the substrings "Do" or "og" will retrieve the term dog. Use substring length 0 for exact match.

## bgl_contractions (0x3b)
bgl_contractions (0x3b)
-----------------------

Contains a value like this:

Expand All @@ -20,10 +19,10 @@ V-0#Verb|V-0.0#|V-0.1#Infinitive|V-0.1.1#|V-1.0#|V-1.1#|V-1.1.1#Present Simple|V

Value format: `(<contraction> "#" [<value>] "|")+`

The value is in second language, that is for `Babylon Russian-English.BGL` the value in russian.
For `Babylon English-Spanish.BGL` the value is spanish (I guess), etc.
The value is in second language, that is for `Babylon Russian-English.BGL` the value in russian. For `Babylon English-Spanish.BGL` the value is spanish (I guess), etc.

## bgl_about: Glossary manual file (0x41)
bgl_about: Glossary manual file (0x41)
--------------------------------------

Additional information about the dictionary in `.txt` format this may be short info like this:

Expand All @@ -38,15 +37,14 @@ English biological articles to fluent Farsi
Copyright (c) 2009 All rights reserved.
```

In `.pdf` format this may be a quite large document (about 30 pages),
an introduction into the dictionary. It describing structure of an article,
editors, how to use the dictionary.
In `.pdf` format this may be a quite large document (about 30 pages), an introduction into the dictionary. It describing structure of an article, editors, how to use the dictionary.

Format: `<file extension> "\x00" <file contents>`

File extension may be: ".txt", ".pdf"

## bgl_purchaseLicenseMsg (0x2c)
bgl_purchaseLicenseMsg (0x2c)
-----------------------------

Contains a value like this:

Expand All @@ -55,7 +53,8 @@ In order to view this glossary, you must purchase a license.
<br /><a href="http://www.babylon.com/redirects/purchase.cgi?type=170&trid=BPCWHAR">Click here</a> to purchase.
```

## bgl_licenseExpiredMsg (0x2d)
bgl_licenseExpiredMsg (0x2d)
----------------------------

Contains a value like this:

Expand All @@ -65,7 +64,8 @@ In order to view this glossary, you must have a valid license.
<br><a href="http://www.babylon.com/redirects/purchase.cgi?type=130&trid=BPCBRTBR">Renew</a> your license today.
```

## bgl_purchaseAddress (0x2e)
bgl_purchaseAddress (0x2e)
--------------------------

Contains a value like this:

Expand Down
5 changes: 3 additions & 2 deletions doc/entry-filters.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Entry Filters
Entry Filters
-------------

| Name | Default Enabled | Command Flags | Description |
| ---------------------------- | --------------- | ------------------------------------ | --------------------------------------------------------------------------- |
|------------------------------|-----------------|--------------------------------------|-----------------------------------------------------------------------------|
| `trim_whitespaces` | Yes | | Remove leading/trailing whitespaces from word(s) and definition |
| `non_empty_word` | Yes | | Skip entries with empty word |
| `skip_resources` | No | `--skip-resources` | Skip resources / data files |
Expand Down
25 changes: 13 additions & 12 deletions doc/lzo.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
## Install `python-lzo`
Install `python-lzo`
--------------------

- **On Linux**
- **On Linux**

- Make sure `liblzo2-dev` or `liblzo2-devel` is installed.
- Run `sudo pip3 install python-lzo`
- Make sure `liblzo2-dev` or `liblzo2-devel` is installed.
- Run `sudo pip3 install python-lzo`

- **On Android with Termux**
- **On Android with Termux**

- `apt install liblzo`
- `pip install python-lzo`
- `apt install liblzo`
- `pip install python-lzo`

- **On Windows**:
- **On Windows**:

- Open this page: https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-lzo
- If you are using Python 3.7 (32 bit) for example, click on `python_lzo‑1.12‑cp37‑cp37m‑win32.whl`
- Open Start -> type Command -> right-click on Command Prompt -> Run as administrator
- Run `pip install C:\....\python_lzo‑1.12‑cp37‑cp37m‑win32.whl` command, giving the path of downloaded file
- Open this page: https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-lzo
- If you are using Python 3.7 (32 bit) for example, click on `python_lzo‑1.12‑cp37‑cp37m‑win32.whl`
- Open Start -> type Command -> right-click on Command Prompt -> Run as administrator
- Run `pip install C:\....\python_lzo‑1.12‑cp37‑cp37m‑win32.whl` command, giving the path of downloaded file
24 changes: 13 additions & 11 deletions doc/octopus_mdict/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# An Analysis of MDX/MDD File Format
An Analysis of MDX/MDD File Format
==================================

> MDict is a multi-platform open dictionary
which are both questionable. It is not available for every platform, e.g. OS X, Linux. Its dictionary file format is not open. But this has not hindered its popularity, and many dictionaries have been created for it.
which are both questionable. It is not available for every platform, e.g. OS X, Linux. Its dictionary file format is not open. But this has not hindered its popularity, and many dictionaries have been created for it.

This is an attempt to reveal MDX/MDD file format, so that my favarite dictionaries, created by MDict users, could be used elsewhere.

# MDict Files
MDict Files
===========

MDict stores the dictionary definitions, i.e. (key word, explanation) in MDX file and the dictionary reference data, e.g. images, pronunciations, stylesheets in MDD file. Although holding different contents, these two file formats share the same structure.

# MDX and MDD File Formats
MDX and MDD File Formats
========================

See [MDX.svgz](./MDX.svgz) and [MDD.svgz](./MDD.svgz)

# Example Programs
Example Programs
================

## readmdict.py
readmdict.py
------------

readmdict.py is an example implementation in Python. This program can read/extract mdx/mdd files.

Expand Down Expand Up @@ -51,8 +56,7 @@ Out[4]:
'<span style=\'display:block;color:black;\'>.........')
```

`mdx` is an object having all info from a MDX file. `items` is an iterator producing 2-item tuples.
Of each tuple, the first element is the entry text and the second is the explanation. Both are UTF-8 encoded strings.
`mdx` is an object having all info from a MDX file. `items` is an iterator producing 2-item tuples. Of each tuple, the first element is the entry text and the second is the explanation. Both are UTF-8 encoded strings.

Read MDD file and print the first entry::

Expand All @@ -67,6 +71,4 @@ Out[7]:
'\xff\xd8\xff\xe0\x00\x10JFIF...........')
```

`mdd` is an object having all info from a MDD file. `items` is an iterator producing 2-item tuples.
Of each tuple, the first element is the file name and the second element is the corresponding file content.
The file name is encoded in UTF-8. The file content is a plain bytes array.
`mdd` is an object having all info from a MDD file. `items` is an iterator producing 2-item tuples. Of each tuple, the first element is the file name and the second element is the corresponding file content. The file name is encoded in UTF-8. The file content is a plain bytes array.
2 changes: 1 addition & 1 deletion doc/p/__index__.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
| Description | Name | Doc Link |
| ------------------------------ | --------------- | ---------------------------------------------- |
|--------------------------------|-----------------|------------------------------------------------|
| Aard 2 (.slob) | Aard2Slob | [aard2_slob.md](./aard2_slob.md) |
| ABC Medical Notes (SQLite3) | ABCMedicalNotes | [abc_medical_notes.md](./abc_medical_notes.md) |
| Almaany.com (SQLite3) | Almaany | [almaany.md](./almaany.md) |
Expand Down
13 changes: 7 additions & 6 deletions doc/p/aard2_slob.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
## Aard 2 (.slob)
Aard 2 (.slob)
--------------

### General Information

| Attribute | Value |
| --------------- | -------------------------------------------------------- |
|-----------------|----------------------------------------------------------|
| Name | Aard2Slob |
| snake_case_name | aard2_slob |
| Description | Aard 2 (.slob) |
| Extensions | `.slob` |
| Read support | Yes |
| Write support | Yes |
| Single-file | Yes |
| Kind | 🔢 binary |
| Kind | 🔢 binary |
| Sort-on-write | default_no |
| Sort key | (`headword_lower`) |
| Sort key | \(`headword_lower`\) |
| Wiki | [@itkach/slob/wiki](https://github.com/itkach/slob/wiki) |
| Website | [aarddict.org](http://aarddict.org/) |

### Write options

| Name | Default | Type | Comment |
| ---------------------------------- | ------- | ---- | --------------------------------------------------------------- |
|------------------------------------|---------|------|-----------------------------------------------------------------|
| compression | `zlib` | str | Compression Algorithm |
| content_type | | str | Content Type |
| file_size_approx | `0` | int | split up by given approximate file size<br />examples: 100m, 1g |
Expand All @@ -47,6 +48,6 @@ See [doc/pyicu.md](../pyicu.md) file for more detailed instructions on how to in
### Dictionary Applications/Tools

| Name & Website | Source code | License | Platforms | Language |
| ------------------------------------------ | ---------------------------------------------------------------- | ------- | --------- | -------- |
|--------------------------------------------|------------------------------------------------------------------|---------|-----------|----------|
| [Aard 2 for Android](http://aarddict.org/) | [@itkach/aard2-android](https://github.com/itkach/aard2-android) | GPL | Android | Java |
| [Aard2 for Web](http://aarddict.org/) | [@itkach/aard2-web](https://github.com/itkach/aard2-web) | MPL | Web | Java |
Loading

0 comments on commit 9fcceac

Please sign in to comment.