nltk.tuple2str()
¶
-
nltk.
tuple2str
(tagged_token, sep='/')[source]¶ Given the tuple representation of a tagged token, return the corresponding string representation. This representation is formed by concatenating the token’s word string, followed by the separator, followed by the token’s tag. (If the tag is None, then just return the bare word string.)
>>> from nltk.tag.util import tuple2str >>> tagged_token = ('fly', 'NN') >>> tuple2str(tagged_token) 'fly/NN'
Parameters: - tagged_token (tuple(str, str)) – The tuple representation of a tagged token.
- sep (str) – The separator string used to separate word strings from tags.