Submitted by jsonathan t3_10zhf5b in coolgithubprojects
bengouk t1_j83s20s wrote
Cool. But whats with that answer though!?
The tokenize_sentences
function just calls the nltk word_tokenize
with same parameters and returns result? Why not just call the nltk function directly??
the_aligator6 t1_j86pg30 wrote
Encapsulation of external dependency. If the API changes to nltk, you can maintain the same interface and only make the change in one place. If you want to replace nltk, you only have to make the change in one place
Viewing a single comment thread. View all comments