From 2e51b5027a63e00ef5181a833a8a26a4dd13f532 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 8 Jul 2015 18:59:35 +0200 Subject: [PATCH] * Alias Doc to Tokens, for backwards compatibility --- spacy/tokens.pyx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spacy/tokens.pyx b/spacy/tokens.pyx index 9fa07f1ee..22bf6e2dc 100644 --- a/spacy/tokens.pyx +++ b/spacy/tokens.pyx @@ -368,6 +368,11 @@ cdef class Doc: return self[start] +# Enhance backwards compatibility by aliasing Doc to Tokens, for now +Tokens = Doc + + + cdef class Token: """An individual token --- i.e. a word, a punctuation symbol, etc. Created via Doc.__getitem__ and Doc.__iter__.