seancarmody / ngramr

R package to query the Google Ngram Viewer
Other
48 stars 9 forks source link

Support for multi-phrase search and direct corpus specification ("test:eng_2012, испытание:rus_2012") #23

Closed eMPee584 closed 4 years ago

eMPee584 commented 9 years ago

The current structure of ngram.R allows for multi-corpus search of a single word, but doesn't quite cope with a combined search like the given "test:eng_2012, испытание:rus_2012". It also needlessly does a single HTTP request for each phrase string when it could just pass through multiple (in case of single global corpus set).. I tried to at least parse the correct corpora when creating the data.frame ala corpus_parsed <- regmatches(phrases, regexpr("(?<=:).*", phrases, perl=TRUE)), but didn't get much farther. Maybe you can come up with something more routinely than me :+1:

seancarmody commented 9 years ago

Thanks for the help. Keeping up with Google's changes to the ngram site has proved challenging, but certainly appreciated your assistance!

seancarmody commented 4 years ago

I think this works now (although perhaps not as efficiently as it could), so I'll close this issue.