I want to modify the default tokenizer to split URL's into individual words. Here's what I currently have
import spacy
nlp = spacy.blank('en')
infixes = nlp.Defaults.infixes + [r'\.']
infix_regex = spacy.util.compile_infix_regex(infixes)
nlp.tokenizer.infix_finditer = infix_regex.finditer
print(list(nlp('www.internet.com')))
# ['www.internet.com']
# want it to be ['www', '.', 'internet', '.', 'com']
I'm looking at the usage examples and source code for the tokenizer, but I can't work out this particular case.