-
Notifications
You must be signed in to change notification settings - Fork 3
/
bookworm.R
33 lines (22 loc) · 1.39 KB
/
bookworm.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#Attempting to work with Bookworm
library(bookworm)
install.packages("devtools")
library(devtools)
install_github("bmschmidt/Bookworm-Mallet")
?bookworm
totals = bookworm(host="localhost", port = 8005, search_limits=list(),
groups="date_year","counttype"=list("TotalTexts"),
database="viraltexts_bookworm")
plot(totals[totals$date_year %in% 1700:2000,],type='l',main="Total works in the Hathi Trust Public Domain corpus")
totals = bookworm(host="localhost", port = 8005, search_limits=list(),
groups="date_year","counttype"=list("WordCount","TextCount"),
database="viraltexts_bookworm")
totals=totals[totals$date_year %in% 1700:2000,]
plot(totals$date_year,totals$WordCount/totals$TextCount,type='l',main="Average length of works in the Hathi Trust Public Domain corpus")
results = bookworm(host="localhost", port = 8005, search_limits=list("word" = list("war","peace")),
groups="date_year","counttype"=list("WordsPerMillion"),
database="viraltexts_bookworm")
vtBookworm = bookworm(host="localhost", port = 8005, search_limits=list(), "query" = list("text"),
groups="cluster","counttype"=list("TotalTexts"),
database="viraltexts_bookworm")
plot(results[results$date_year %in% 1700:2000,],main="Usage of 'evolution' in the Hathi Trust Public Domain corpus")