Skip to content

Commit

Permalink
Merge pull request #187 from goodmami/v0.9.4
Browse files Browse the repository at this point in the history
V0.9.4 Add OEWN 2022
  • Loading branch information
goodmami authored May 7, 2023
2 parents a95ad80 + 8a92cce commit a80a55a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
## [v0.9.4]

**Release date: 2023-05-07**

### Index

Expand Down Expand Up @@ -528,6 +530,7 @@ the https://github.com/nltk/wordnet/ code which had been effectively
abandoned, but this is an entirely new codebase.


[v0.9.4]: ../../releases/tag/v0.9.4
[v0.9.3]: ../../releases/tag/v0.9.3
[v0.9.2]: ../../releases/tag/v0.9.2
[v0.9.1]: ../../releases/tag/v0.9.1
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ it from PyPI and download some data:

```console
$ pip install wn
$ python -m wn download oewn:2021 # the Open English WordNet 2021
$ python -m wn download oewn:2022 # the Open English WordNet 2022
```

Then start exploring:

```python
>>> import wn
>>> en = wn.Wordnet('oewn:2021') # Create Wordnet object to query
>>> ss = en.synsets('win')[0] # Get the first synset for 'win'
>>> ss.definition() # Get the synset's definition
>>> en = wn.Wordnet('oewn:2022') # Create Wordnet object to query
>>> ss = en.synsets('win', pos='v')[0] # Get the first synset for 'win'
>>> ss.definition() # Get the synset's definition
'be the winner in a contest or competition; be victorious'
```

Expand Down Expand Up @@ -73,7 +73,7 @@ use with the Portuguese wordnet [OpenWordnet-PT]).

| Name | Specifier | # Synsets | Notes |
| ------------------------------------------ | ---------------------- | --------: | ----- |
| [Open English WordNet] | `oewn:2021`<br/> `ewn:2020`<br/> `ewn:2019` | 120039<br/>120053<br/>117791 | Recommended<br/>&nbsp;<br/>&nbsp; |
| [Open English WordNet] | `oewn:2022`<br/> `oewn:2021`<br/> `ewn:2020`<br/> `ewn:2019` | 120068<br/>120039<br/>120053<br/>117791 | Recommended<br/>&nbsp;<br/>&nbsp;<br/>&nbsp; |
| [OMW English Wordnet based on WordNet 3.0] | `omw-en:1.4` | 117659 | Included with `omw:1.4` |
| [OMW English Wordnet based on WordNet 3.1] | `omw-en31:1.4` | 117791 | |
| [OpenWordnet-EN] | `own-en:1.0.0` | 117659 | Included with `own:1.0.0` |
Expand Down
1 change: 1 addition & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ index. This is helpful to see what is available for downloading.
$ python -m wn projects
ic cili 1.0 [---] Collaborative Interlingual Index
ic oewn 2022 [en] Open English WordNet
ic oewn 2021 [en] Open English WordNet
ic ewn 2020 [en] Open English WordNet
ic ewn 2019 [en] Open English WordNet
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ classifiers = [
dependencies = [
"requests",
"tomli",
"importlib_resources; python_version < '3.7'",
"typing-extensions; python_version < '3.8'",
]

Expand Down
2 changes: 1 addition & 1 deletion wn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
Wordnet
)

__version__ = '0.9.3'
__version__ = '0.9.4'
5 changes: 3 additions & 2 deletions wn/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ def _get_decompressed(source: Path) -> Iterator[Path]:
tmp = tempfile.NamedTemporaryFile(suffix='.xml', delete=False)
path = Path(tmp.name)
try:
# for typing issues, see https://github.com/python/mypy/issues/15031
if gzipped:
with gzip.open(source, 'rb') as gzip_src:
shutil.copyfileobj(gzip_src, tmp)
shutil.copyfileobj(gzip_src, tmp) # type: ignore
else: # xzipped
with lzma.open(source, 'rb') as lzma_src:
shutil.copyfileobj(lzma_src, tmp)
shutil.copyfileobj(lzma_src, tmp) # type: ignore

tmp.close() # Windows cannot reliably reopen until it's closed

Expand Down
2 changes: 1 addition & 1 deletion wn/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _url_for_obj(
'lexicon': lexicon,
name: obj.id
}
return request.url_for(name, **kwargs)
return str(request.url_for(name, **kwargs))


def make_lexicon(lex: wn.Lexicon, request: Request) -> dict:
Expand Down

0 comments on commit a80a55a

Please sign in to comment.