Skip to content

Commit

Permalink
modify method return type
Browse files Browse the repository at this point in the history
  • Loading branch information
lll-lll-lll-lll committed Feb 3, 2023
1 parent 7c9b44b commit 45a9c2e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sent_pattern/tags.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import defaultdict
from spacy.tokens import Doc
from sent_pattern.core.elements.elements import RootElements
from sent_pattern.core.factory.elements import ElementsFactory
from sent_pattern.core.interface.Ipattern import IBaseSentencePattern
from sent_pattern.core.factory.pattern import SentencePattern
from sent_pattern.core.type import DepLemmaListType

Expand All @@ -24,7 +24,7 @@ def create_dep_list(doc: Doc) -> DepLemmaListType:
return dict(dep_list)


def create_elements(dep_list: DepLemmaListType) -> ElementsFactory:
def create_elements(dep_list: DepLemmaListType) -> RootElements:
"""
Parameters
----------
Expand All @@ -33,24 +33,24 @@ def create_elements(dep_list: DepLemmaListType) -> ElementsFactory:
Returns
-------
elements: ElementsInterface
elements: RootElements
classes have subject, verb, adjective, and object
"""
elements = ElementsFactory.make_root_elements(
dep_list=dep_list)
return elements


def create_sent_pattern(elements: ElementsFactory) -> IBaseSentencePattern:
def create_sent_pattern(elements: RootElements) -> SentencePattern:
"""
Parameters
----------
elements : ElementsInterface
elements : RootElements
classes have subject, verb, adjective, and object
Returns
-------
pattern : BaseSentencePatternInterface
pattern : SentencePattern
"""
pattern = SentencePattern(elements)
return pattern.pattern_type
return pattern

0 comments on commit 45a9c2e

Please sign in to comment.