Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from ku-nlp/feature/handle_compression_refactor
Browse files Browse the repository at this point in the history
Feature/handle compression refactor
  • Loading branch information
kevin3314 authored Mar 29, 2022
2 parents 433ad49 + aa2826b commit f44b675
Show file tree
Hide file tree
Showing 9 changed files with 416 additions and 379 deletions.
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ verify_ssl = true

[dev-packages]
pytest = "*"
ipython = "<8.0"
ipdb = "*"
kyoto-reader = {editable = true,path = "."}
sphinx = "*"
Expand All @@ -13,6 +14,8 @@ sphinx-autodoc-typehints = "*"
recommonmark = "*"
twine = "*"
sphinx-rtd-theme = "*"
autopep8 = "*"
typing-extensions = "*"

[packages]

Expand Down
419 changes: 218 additions & 201 deletions Pipfile.lock

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta:__legacy__"
build-backend = "setuptools.build_meta:__legacy__"

[tool.autopep8]
max_line_length = 120
ignore = "E501,W6" # or ["E501", "W6"]
in-place = true
recursive = true
aggressive = 3
1 change: 1 addition & 0 deletions src/kyoto_reader/base_phrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class BasePhrase:
parent (Optional[BasePhrase]): Dependency parent.
children (List[BasePhrase]): Dependency children.
"""

def __init__(self,
tag: Tag,
dmid_offset: int,
Expand Down
2 changes: 2 additions & 0 deletions src/kyoto_reader/coreference.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Mention(BasePhrase):
eids (set): Entity IDs.
eids_unc (set): Uncertain entity IDs. "Uncertain" means the mention is annotated with "≒".
"""

def __init__(self, bp: BasePhrase):
super().__init__(bp.tag, bp.dmids[0], bp.dtid, bp.sid, bp.doc_id, parent=bp.parent, children=bp.children)
self.eids: Set[int] = set()
Expand Down Expand Up @@ -64,6 +65,7 @@ class Entity:
taigen (bool, optional): Whether this entity is 体言 or not.
yougen (bool, optional): Whether this entity is 用言 or not.
"""

def __init__(self, eid: int, exophor: Optional[str] = None):
self.eid: int = eid
self.exophor: Optional[str] = exophor
Expand Down
2 changes: 2 additions & 0 deletions src/kyoto_reader/pas.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class BaseArgument:
"""A base class for all kinds of arguments"""

def __init__(self, dep_type: str, mode: str):
self.dep_type: str = dep_type
self.mode: str = mode
Expand Down Expand Up @@ -83,6 +84,7 @@ class SpecialArgument(BaseArgument):
eid (int): 外界照応詞のエンティティID
mode (str): モード
"""

def __init__(self, exophor: str, eid: int, mode: str):
self.eid = eid
dep_type = 'exo'
Expand Down
Loading

0 comments on commit f44b675

Please sign in to comment.