Skip to content

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

Open
@schorfma

Description

@schorfma

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation and website

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions