Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'MorphPipelineScheme' object has no attribute 'keys' #85

Open
tonal opened this issue Jul 28, 2023 · 0 comments
Open

AttributeError: 'MorphPipelineScheme' object has no attribute 'keys' #85

tonal opened this issue Jul 28, 2023 · 0 comments

Comments

@tonal
Copy link

tonal commented Jul 28, 2023

from .grammars.addr import ADDR_PART

for li in ADDR_PART.normalized.as_bnf.source:
    print(li, file=out)

Error:

Traceback (most recent call last):
  File "/home/tonal/lang/projects/promsoft/ml/ner/ner-kadastr/get_addr_nat.py", line 83, in <module>
    main()
  File "/home/tonal/lang/projects/promsoft/ml/ner/ner-kadastr/get_addr_nat.py", line 29, in main
    for li in ADDR_PART.normalized.as_bnf.source:
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/constructors.py", line 130, in as_bnf
    return self.transform(
           ^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/constructors.py", line 96, in transform
    return TransformatorsComposition(transformators)(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/visitor.py", line 28, in __call__
    item = transformator()(item)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 100, in __call__
    return super(BNFTransformator, self).__call__(root)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 66, in __call__
    return self.visit(root)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 135, in visit_InterpretationRule
    item = self.visit_WrapperRule(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 120, in visit_WrapperRule
    item = self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 135, in visit_InterpretationRule
    item = self.visit_WrapperRule(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 120, in visit_WrapperRule
    item = self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 113, in visit_Rule
    return BNFRule([self.visit(_) for _ in item.productions])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 113, in <listcomp>
    return BNFRule([self.visit(_) for _ in item.productions])
                    ^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 85, in visit_Production
    [self.visit_term(_) for _ in item.terms],
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 85, in <listcomp>
    [self.visit_term(_) for _ in item.terms],
     ^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 79, in visit_term
    return self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 135, in visit_InterpretationRule
    item = self.visit_WrapperRule(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 120, in visit_WrapperRule
    item = self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 113, in visit_Rule
    return BNFRule([self.visit(_) for _ in item.productions])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 113, in <listcomp>
    return BNFRule([self.visit(_) for _ in item.productions])
                    ^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 85, in visit_Production
    [self.visit_term(_) for _ in item.terms],
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 85, in <listcomp>
    [self.visit_term(_) for _ in item.terms],
     ^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 79, in visit_term
    return self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 135, in visit_InterpretationRule
    item = self.visit_WrapperRule(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 120, in visit_WrapperRule
    item = self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 113, in visit_Rule
    return BNFRule([self.visit(_) for _ in item.productions])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 113, in <listcomp>
    return BNFRule([self.visit(_) for _ in item.productions])
                    ^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 85, in visit_Production
    [self.visit_term(_) for _ in item.terms],
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 85, in <listcomp>
    [self.visit_term(_) for _ in item.terms],
     ^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 79, in visit_term
    return self.visit(item)
           ^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/transformators.py", line 73, in visit
    item = self.resolve_method(item)(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/rule/bnf.py", line 150, in visit_PipelineRule
    return item.pipeline.as_bnf
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/pipelines.py", line 116, in as_bnf
    return self.bnf(self.productions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/pipelines.py", line 20, in __init__
    productions = list(productions)
                  ^^^^^^^^^^^^^^^^^
  File "/home/tonal/.pyenv/versions/ner-kadastr/lib/python3.11/site-packages/yargy/pipelines.py", line 108, in productions
    for key in self.keys:
               ^^^^^^^^^
AttributeError: 'MorphPipelineScheme' object has no attribute 'keys'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant