Mercurial > hg > python
view lazyBug.py @ 74:0245bc07f16c simple
try to simplify Rows/Cols (do without?) by hiving off the run-counts copletely
| author | Henry Thompson <ht@markup.co.uk> |
|---|---|
| date | Sat, 09 Aug 2025 15:59:19 -0400 |
| parents | bd1db1ed4c25 |
| children |
line wrap: on
line source
'''Illustrate problem with writable cache in LazySubsequence''' from nltk.corpus import brown import nltk, sys data = brown.tagged_sents(categories='news', tagset='universal') train_data=data[:1000] y=train_data[0] print('initial:',y==train_data[0],train_data[0][:2]) train_data[0].insert(0,('<s>','<s>')) print('modified:',y==train_data[0],train_data[0][:2]) z=len([s for s in train_data]) print('post-view:',y==train_data[0],train_data[0][:2]) print("\nnltk: %s\npython: %s"%(nltk.version_info,sys.version))
