spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Code example discrepancy for `Span.lemma_` in API docs

Open schorfma opened this issue 3 months ago • 1 comments

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 avatar Apr 01 '24 09:04 schorfma

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

Greetings Martin

schorfma avatar Apr 12 '24 14:04 schorfma