I am parsing text for NLP. And I faced unfamiliar grammer below url.
text[:]
https://github.com/facebookresearch/ParlAI/blob/master/parlai/core/dict.py#L39
I assume text
is a natural sentence like text = 'what does Duane Boutte appear in?'
. I know :
with index number means array access like text[:3] -> 'wha'
. But I do not know without index number. And I also know :
is used for access to multi dimensional array like data[:][:3]
.
Could you image above link's text[:]
? This function split sentence to tokens.
Update
I found it is a copy operation. See Martijn Pieters and Jean-François Fabre comments