Skip to content

Commit

Permalink
Yomichan: add beautifulsoup4 to dependencies, #577
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Sep 7, 2024
1 parent eb9eeb4 commit 5fe93f4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/p/yomichan.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@
| rule_vs_defi_pattern | | str | When given, if any substring of an entry's definition matches this regular expression, then the term(s) created from entry are labeled as suru verb. Yomichan uses this information to match conjugated forms of words. `^` and `$` can be used to match start and end of lines, respectively. For example, setting this option to `^スル$` identifies entries where there's a line of 'スル'. |
| rule_vk_defi_pattern | | str | When given, if any substring of an entry's definition matches this regular expression, then the term(s) created from entry are labeled as kuru verb. Yomichan uses this information to match conjugated forms of words. `^` and `$` can be used to match start and end of lines, respectively. For example, setting this option to `^\(動カ変\)$` identifies entries where there's a line of '(動カ変)'. |
| rule_adji_defi_pattern | | str | When given, if any substring of an entry's definition matches this regular expression, then the term(s) created from entry are labeled as i-adjective. Yomichan uses this information to match conjugated forms of words. `^` and `$` can be used to match start and end of lines, respectively. For example, setting this option to `r'^\(形\)$'` identify entries where there's a line of '(形)'. |

### Dependencies for writing

PyPI Links: [beautifulsoup4](https://pypi.org/project/beautifulsoup4)

To install, run

```sh
pip3 install beautifulsoup4
```
3 changes: 3 additions & 0 deletions plugins-meta/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,9 @@
"rule_vs_defi_pattern": "",
"rule_vk_defi_pattern": "",
"rule_adji_defi_pattern": ""
},
"writeDepends": {
"bs4": "beautifulsoup4"
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions pyglossary/plugins/yomichan.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def _uniqueList(lst: "Sequence") -> "list[Any]":


class Writer:
depends = {
"bs4": "beautifulsoup4",
}

_term_bank_size = 10_000
_term_from_headword_only = True
_no_term_from_reading = True
Expand Down

0 comments on commit 5fe93f4

Please sign in to comment.