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

Code example discrepancy for Span.lemma_ in API docs #13405

Open
schorfma opened this issue Apr 1, 2024 · 1 comment · May be fixed by #13436
Open

Code example discrepancy for Span.lemma_ in API docs #13405

schorfma opened this issue Apr 1, 2024 · 1 comment · May be fixed by #13436
Labels
docs Documentation and website

Comments

@schorfma
Copy link

schorfma commented Apr 1, 2024

Hello spaCy team,

I found a small discrepancy in the documentation.


The attribute lemma_ for a Span is described as follows in the API docs:

The span's lemma. Equivalent to "".join(token.text_with_ws for token in span).

Suggested Change

The equivalent code example should not contain token.text_with_ws in the comprehension, but token.lemma_ + token.whitespace_:

- | `lemma_`       | The span's lemma. Equivalent to `"".join(token.text_with_ws for token in span)`. ~~str~~                                      |
+ | `lemma_`       | The span's lemma. Equivalent to `"".join(token.lemma_ + token.whitespace_ for token in span).strip()`. ~~str~~                |

Which page or section is this issue related to?

@schorfma schorfma changed the title Code example discrepancy for Span.lemma_ in API docs Code example discrepancy for Span.lemma_ in API docs Apr 2, 2024
@svlandeg svlandeg added the docs Documentation and website label Apr 4, 2024
schorfma added a commit to schorfma/spaCy-Docs-Fork that referenced this issue Apr 12, 2024
@schorfma
Copy link
Author

I provided corrections for this issue and two further small errors in the PR #13436.

Greetings
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation and website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants