Published
Edited
Sep 29, 2018
1 fork
2 stars
Insert cell
Insert cell
Insert cell
d3.blob('https://github.com/nltk/nltk_data/raw/gh-pages/packages/corpora/abc.zip', { mode: 'no-cors' }).then(_=>{console.log(_); return _; }).catch(_=>{ console.error(_); return _; })
Insert cell
d3.buffer('https://github.com/nltk/nltk_data/raw/gh-pages/packages/corpora/abc.zip', { mode: 'no-cors' }).then(_=>{console.log(_); return _; }).catch((_, __)=>{ console.error(_,__); return _; })
Insert cell
Insert cell
Insert cell
d3.buffer('https://cors-anywhere.herokuapp.com/' + 'https://github.com/nltk/nltk_data/raw/gh-pages/packages/corpora/abc.zip')
Insert cell
selected_abc_text = d3
.buffer('https://cors-anywhere.herokuapp.com/' + 'https://github.com/nltk/nltk_data/raw/gh-pages/packages/corpora/abc.zip')
.then(arrayBuffer=> {
let zip = JSZip();
return zip.loadAsync(arrayBuffer);
})
.then(zip=>{
return zip.file(`abc/${abc_rural_science_choice}.txt`).async('string');
})
Insert cell
viewof abc_rural_science_choice = select(['rural', 'science'])
Insert cell
abc_rural_science_choice
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
next_button
const random_starting = Math.ceil(d3.randomUniform(0, selected_abc_text.length-block_size)())
const selected_abc_text_string = await selected_abc_text;
const current_selected_block = selected_abc_text_string.slice(random_starting,random_starting+block_size);
return current_selected_block;
//new Date()
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more