Skip to content

Commit

Permalink
fix: use my C++ DSL converter
Browse files Browse the repository at this point in the history
  • Loading branch information
Crissium committed Nov 4, 2023
1 parent 3900ad9 commit 4d898a1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 720 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ The dark theme is not built in, but rendered with the [Dark Reader Firefox exten

- [ ] Add support for Babylon BGL glossary format
- [X] Add support for StarDict format
- [X] Add support for ABBYY Lingvo DSL format[^4]
- [ ] Reduce DSL indexing and parsing time
- [X] Add support for ABBYY Lingvo DSL format
- [X] Reduce DSL parsing time
- [X] Reduce the memory footprint of the MDict Reader
- [ ] Inline styles to prevent them from being applied to the whole page (The commented-out implementation in [`server/app/dicts/mdict/html_cleaner.py`](/server/app/dicts/mdict/html_cleaner.py) breaks richly-formatted dictionaries.)[^5]
- [X] Reorganise APIs (to facilitate dictionary groups)
Expand All @@ -63,7 +63,6 @@ The dark theme is not built in, but rendered with the [Dark Reader Firefox exten
- [X] Make the suggestion size customisable
- [X] Allow configure suggestion matching mode, listening address, running mode, etc. via a configuration file, without modifying code
- [X] Add a timestamp field to suggestions to avoid newer suggestions being overridden by older ones
- [ ] Use a linter
- [ ] Full-text search

### Client-side
Expand All @@ -79,7 +78,6 @@ The dark theme is not built in, but rendered with the [Dark Reader Firefox exten

### Issue backlog

- [ ] Malformed DSL tags (perhaps I'll write a C++ parser for DSL)
- [ ] Make the dialogues children of the root element (How can I do this with nested dialogues?)

## Usage
Expand All @@ -89,15 +87,18 @@ The dark theme is not built in, but rendered with the [Dark Reader Firefox exten
This project utilises some Python 3.10 features, such as the _match_ syntax, and a minimal set of dependencies:
```
PyYAML # for better efficiency, please install libyaml before building the wheel
Flask
Flask # the web framework
Flask-Cors
waitress
python-idzip
lxml
python-lzo
xxhash
waitress # the WSGI server
python-idzip # for dictzip
lxml # for XDXF-formatted StarDicts
python-lzo # for v1/v2 MDict
xxhash # for v3 MDict
dsl2html # for DSL
```

The package [`dsl2html`](https://github.com/Crissium/python-dsl) is mine, and could be used by other projects.

In order to enable the feature of morphology analysis, you need to install the Python package `hunspell` and place the Hunspell dictionaries into `~/.silverdict/hunspell`.

In order to enable the feature of Chinese conversion, you need to install the Python package `opencc`.
Expand Down Expand Up @@ -173,8 +174,6 @@ I would also express my gratitude to Jiang Qian for his suggestions, encourageme

[^1]: A note about type hinting in the code: I know for proper type hinting I should use the module `typing`, but the current way is a little easier to write and can be understood by VS Code.

[^4]: I tested with an extremely ill-formed DSL dictionary, and before such devilry my cleaning code is powerless. I will look into how GoldenDict handles this.

[^5]: The use of a custom styling manager such as Dark Reader is recommended until I fix this, as styles for different dictionaries meddle with each other. Or better, if you know CSS, you could just edit the dictionaries' stylesheets to make them less intrusive and individualistic.

[^6]: A Russian-speaking friend told me that it is unusual to type Russian on an American keyboard, so whether this feature is useful is open to doubt.
Expand Down
103 changes: 0 additions & 103 deletions server/app/dicts/dsl/layer.py

This file was deleted.

Loading

0 comments on commit 4d898a1

Please sign in to comment.