Libraries / R Setup

library(reticulate)
library(rJava)
library(tagger)
##r chunk
#devtools::install_github("bradleyboehmke/harrypotter")
library(harrypotter)

##pick one of the harrypotter books to analyze with your POS text
##https://github.com/bradleyboehmke/harrypotter check out the options
##load it using data(book title)

data("prisoner_of_azkaban")
hp = head(prisoner_of_azkaban)
##r chunk
#devtools::install_github("trinker/termco")
#devtools::install_github("trinker/coreNLPsetup")
#devtools::install_github("trinker/tagger")
#install.packages("qdap")
#devtools::install_github("bnosac/RDRPOSTagger")
py_config()
## python:         /home/kaiyan_wei/.local/share/r-miniconda/envs/r-reticulate/bin/python
## libpython:      /home/kaiyan_wei/.local/share/r-miniconda/envs/r-reticulate/lib/libpython3.6m.so
## pythonhome:     /home/kaiyan_wei/.local/share/r-miniconda/envs/r-reticulate:/home/kaiyan_wei/.local/share/r-miniconda/envs/r-reticulate
## version:        3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)  [GCC 7.3.0]
## numpy:          /home/kaiyan_wei/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/numpy
## numpy_version:  1.17.4
py_module_available("spacy")
## [1] TRUE
py_module_available("nltk")
## [1] TRUE
##python chunk
import spacy
import nltk
import pandas as pd
book_data = r.hp

Tagger Package

library(rJava)
library(tagger)
tag_pos(prisoner_of_azkaban[1])
## [1] "OWL/NNP POST/NNP Harry/NNP Potter/NNP was/VBD a/DT highly/RB unusual/JJ boy/NN in/IN many/JJ ways/NNS ./. For/IN one/CD thing/NN ,/, he/PRP hated/VBD the/DT summer/NN holidays/NNS more/RBR than/IN any/DT other/JJ time/NN of/IN year/NN ./. For/IN another/DT ,/, he/PRP really/RB wanted/VBD to/TO do/VB his/PRP$ homework/NN but/CC was/VBD forced/VBN to/TO do/VB it/PRP in/IN secret/JJ ,/, in/IN the/DT dead/JJ of/IN night/NN ./. And/CC he/PRP also/RB happened/VBD to/TO be/VB a/DT wizard/NN ./. It/PRP was/VBD nearly/RB midnight/NN ,/, and/CC he/PRP was/VBD lying/VBG on/IN his/PRP$ stomach/NN in/IN bed/NN ,/, the/DT blankets/NNS drawn/VBN right/RB over/IN his/PRP$ head/NN like/IN a/DT tent/NN ,/, a/DT flashlight/NN in/IN one/CD hand/NN and/CC a/DT large/JJ leather-bound/NN book/NN (/-LRB- A/DT History/NN of/IN Magic/NNP by/IN Bathilda/NNP Bagshot/NNP )/-RRB- propped/VBN open/JJ against/IN the/DT pillow/NN ./. Harry/NNP moved/VBD the/DT tip/NN of/IN his/PRP$ eagle-feather/JJ quill/NN down/IN the/DT page/NN ,/, frowning/VBG as/IN he/PRP looked/VBD for/IN something/NN that/WDT would/MD help/VB him/PRP write/VB his/PRP$ essay/NN ,/, \"/`` Witch/UH Burning/VBG in/IN the/DT Fourteenth/NNP Century/NNP Was/VBD Completely/RB Pointless/NNP discuss/VBP ./. \"/'' The/DT quill/NN paused/VBD at/IN the/DT top/NN of/IN a/DT likely-looking/JJ paragraph/NN ./. Harry/NNP Pushed/VBD his/PRP$ round/NN glasses/NNS up/IN the/DT bridge/NN of/IN his/PRP$ nose/NN ,/, moved/VBD his/PRP$ flashlight/NN closer/RBR to/TO the/DT book/NN ,/, and/CC read/VBD :/: Non-magic/JJ people/NNS (/-LRB- more/RBR commonly/RB known/VBN as/IN Muggles/NNS )/-RRB- were/VBD particularly/RB afraid/JJ of/IN magic/NN in/IN medieval/JJ times/NNS ,/, but/CC not/RB very/RB good/JJ at/IN recognizing/VBG it/PRP ./. On/IN the/DT rare/JJ occasion/NN that/IN they/PRP did/VBD catch/VB a/DT real/JJ witch/NN or/CC wizard/NN ,/, burning/NN had/VBD no/DT effect/NN whatsoever/RB ./. The/DT witch/NN or/CC wizard/NN would/MD perform/VB a/DT basic/JJ Flame/NN Freezing/NNP Charm/NNP and/CC then/RB pretend/VB to/TO shriek/VB with/IN pain/NN while/IN enjoying/VBG a/DT gentle/JJ ,/, tickling/VBG sensation/NN ./. Indeed/RB ,/, Wendelin/NNP the/DT Weird/NNP enjoyed/VBD being/VBG burned/VBN so/RB much/RB that/IN she/PRP allowed/VBD herself/PRP to/TO be/VB caught/VBN no/RB less/JJR than/IN fortyseven/CD times/NNS in/IN various/JJ disguises/NNS ./. Harry/NNP put/VBD his/PRP$ quill/NN between/IN his/PRP$ teeth/NNS and/CC reached/VBD underneath/IN his/PRP$ pillow/NN for/IN his/PRP$ ink/NN bottle/NN and/CC a/DT roll/NN of/IN parchment/NN ./. Slowly/RB and/CC very/RB carefully/RB he/PRP unscrewed/VBD the/DT ink/NN bottle/NN ,/, dipped/VBD his/PRP$ quill/NN into/IN it/PRP ,/, and/CC began/VBD to/TO write/VB ,/, pausing/VBG every/DT now/RB and/CC then/RB to/TO listen/VB ,/, because/IN if/IN any/DT of/IN the/DT Dursleys/NNPS heard/VBD the/DT scratching/VBG of/IN his/PRP$ quill/NN on/IN their/PRP$ way/NN to/TO the/DT bathroom/NN ,/, he/PRP 'd/MD probably/RB find/VB himself/PRP locked/VBN in/IN the/DT cupboard/NN under/IN the/DT stairs/NNS for/IN the/DT rest/NN of/IN the/DT summer/NN ./. The/DT Dursley/NNP family/NN of/IN number/NN four/CD ,/, Privet/NNP Drive/NNP ,/, was/VBD the/DT reason/NN that/IN Harry/NNP never/RB enjoyed/VBD his/PRP$ summer/NN holidays/NNS ./. Uncle/NN Vernon/NNP ,/, Aunt/NNP Petunia/NNP ,/, and/CC their/PRP$ son/NN ,/, Dudley/NNP ,/, were/VBD Harry/NNP 's/POS only/JJ living/NN relatives/NNS ./. They/PRP were/VBD Muggles/NNP ,/, and/CC they/PRP had/VBD a/DT very/RB medieval/JJ attitude/NN toward/IN magic/NN ./. Harry/NNP 's/POS dead/JJ parents/NNS ,/, who/WP had/VBD been/VBN a/DT witch/NN and/CC wizard/NN themselves/PRP ,/, were/VBD never/RB mentioned/VBN under/IN the/DT Dursleys/NNPS '/POS roof/NN For/IN years/NNS ,/, Aunt/NNP Petunia/NNP and/CC Uncle/NNP Vernon/NNP had/VBD hoped/VBN that/IN if/IN they/PRP kept/VBD Harry/NNP as/IN downtrodden/JJ as/IN possible/JJ ,/, they/PRP would/MD be/VB able/JJ to/TO squash/VB the/DT magic/NN out/IN of/IN him/PRP ./. To/TO their/PRP$ fury/NN ,/, they/PRP had/VBD been/VBN unsuccessful/JJ ./. These/DT days/NNS they/PRP lived/VBD in/IN terror/NN of/IN anyone/NN finding/VBG out/RP that/IN Harry/NNP had/VBD spent/VBN most/RBS of/IN the/DT last/JJ two/CD years/NNS at/IN Hogwarts/NNS School/NNP of/IN Witchcraft/NNP and/CC Wizardry/NNP ./. The/DT most/RBS they/PRP could/MD do/VB ,/, however/RB ,/, was/VBD to/TO lock/VB away/RB Harry/NNP 's/POS spellbooks/NNS ,/, wand/VBD ,/, cauldron/NN ,/, and/CC broomstick/NN at/IN the/DT start/NN of/IN the/DT summer/NN break/NN ,/, and/CC forbid/VBD him/PRP to/TO talk/VB to/TO the/DT neighbors/NNS ./. This/DT separation/NN from/IN his/PRP$ spellbooks/NNS had/VBD been/VBN a/DT real/JJ problem/NN for/IN Harry/NNP ,/, because/IN his/PRP$ teachers/NNS at/IN Hogwarts/NNS had/VBD given/VBN him/PRP a/DT lot/NN of/IN holiday/NN work/NN ./. One/CD of/IN the/DT essays/NNS ,/, a/DT particularly/RB nasty/JJ one/CD about/IN shrinking/VBG potions/NNS ,/, was/VBD for/IN Harry/NNP 's/POS least/JJS favorite/JJ teacher/NN ,/, Professor/NNP Snape/NNP ,/, who/WP would/MD be/VB delighted/JJ to/TO have/VB an/DT excuse/NN to/TO give/VB Harry/NNP detention/NN for/IN a/DT month/NN ./. Harry/NNP had/VBD therefore/RB seized/VBN his/PRP$ chance/NN in/IN the/DT first/JJ week/NN of/IN the/DT holidays/NNS ./. While/IN Uncle/NNP Vernon/NNP ,/, Aunt/NNP Petunia/NNP ,/, and/CC Dudley/NNP had/VBD gone/VBN out/RB into/IN the/DT front/NN garden/NN to/TO admire/VB Uncle/NNP Vernon/NNP 's/POS new/JJ company/NN car/NN (/-LRB- in/IN very/RB loud/JJ voices/NNS ,/, so/RB that/IN the/DT rest/NN of/IN the/DT street/NN would/MD notice/VB it/PRP too/RB )/-RRB- ,/, Harry/NNP had/VBD crept/VBN downstairs/RB ,/, picked/VBD the/DT lock/NN on/IN the/DT cupboard/NN under/IN the/DT stairs/NNS ,/, grabbed/VBD some/DT of/IN his/PRP$ books/NNS ,/, and/CC hidden/JJ them/PRP in/IN his/PRP$ bedroom/NN ./. As/RB long/RB as/IN he/PRP did/VBD n't/RB leave/VB spots/NNS of/IN ink/NN on/IN the/DT sheets/NNS ,/, the/DT Dursleys/NNPS need/VBP never/RB know/VB that/IN he/PRP was/VBD studying/VBG magic/NN by/IN night/NN ./. Harry/NNP was/VBD particularly/RB keen/JJ to/TO avoid/VB trouble/NN with/IN his/PRP$ aunt/NN and/CC uncle/NN at/IN the/DT moment/NN ,/, as/IN they/PRP were/VBD already/RB in/IN an/DT especially/RB bad/JJ mood/NN with/IN him/PRP ,/, all/DT because/IN he/PRP 'd/MD received/VBD a/DT telephone/NN call/NN from/IN a/DT fellow/NN wizard/NN one/CD week/NN into/IN the/DT school/NN vacation/NN ./. Ron/NNP Weasley/NNP ,/, who/WP was/VBD one/CD of/IN Harry/NNP 's/POS best/JJS friends/NNS at/IN Hogwarts/NNS ,/, came/VBD from/IN a/DT whole/JJ family/NN of/IN wizards/NNS ./. This/DT meant/VBD that/IN he/PRP knew/VBD a/DT lot/NN of/IN things/NNS Harry/NNP did/VBD n't/RB ,/, but/CC had/VBD never/RB used/VBN a/DT telephone/NN before/IN ./. Most/RBS unluckily/RB ,/, it/PRP had/VBD been/VBN Uncle/NNP Vernon/NNP who/WP had/VBD answered/VBN the/DT call/NN ./. \"/'' Vernon/NNP Dursley/NNP speaking/NN ./. \"/'' Harry/NNP ,/, who/WP happened/VBD to/TO be/VB in/IN the/DT room/NN at/IN the/DT time/NN ,/, froze/VBD as/RB he/PRP heard/VBD Ron/NNP 's/POS voice/NN answer/NN ./. \"/'' HELLO/NNP ?/. HELLO/NNP ?/. CAN/NNP YOU/PRP HEAR/NN ME/NNP ?/. I/PRP --/: WANT/NNP --/: TO/TO --/: TALK/NNP --/: TO/TO --/: HARRY/NNP --/: POTTER/NNP !/. \"/'' Ron/NNP was/VBD yelling/VBG so/RB loudly/RB that/IN Uncle/NNP Vernon/NNP jumped/VBD and/CC held/VBD the/DT receiver/NN a/DT foot/NN away/RB from/IN his/PRP$ ear/NN ,/, staring/VBG at/IN it/PRP with/IN an/DT expression/NN of/IN mingled/JJ fury/NN and/CC alarm/NN ./. \"/'' WHO/WP IS/VBZ THIS/NNP ?/. \"/'' he/PRP roared/VBD in/IN the/DT direction/NN of/IN the/DT mouthpiece/NN ./. \"/'' WHO/WP ARE/VBP YOU/PRP ?/. \"/'' \"/`` RON/NNP --/: WEASLEY/NNP !/. \"/'' Ron/NNP bellowed/VBD back/RB ,/, as/IN though/IN he/PRP and/CC Uncle/NNP Vernon/NNP were/VBD speaking/VBG from/IN opposite/JJ ends/NNS of/IN a/DT football/NN field/NN ./. \"/'' I'M/NNP --/: A/DT --/: FRIEND/NNP --/: OF/IN --/: HARRY/NNP 'S/POS --/: FROM/NNP --/: SCHOOL/JJ --\"/JJ Uncle/NNP Vernon/NNP 's/POS small/JJ eyes/NNS swiveled/VBD around/IN to/TO Harry/NNP ,/, who/WP was/VBD rooted/VBN to/TO the/DT spot/NN ./. \"/'' THERE/JJR IS/VBZ NO/DT HARRY/NNP POTTER/NNP HERE/NNP !/. \"/'' he/PRP roared/VBD ,/, now/RB holding/VBG the/DT receiver/NN at/IN arm/NN 's/POS length/NN ,/, as/IN though/IN frightened/VBN it/PRP might/MD explode/VB ./. \"/'' I/PRP DON'T/VB KNOW/NNP WHAT/WDT SCHOOL/NNP YOURE/NNP TALKING/NNP ABOUT!/NNP NEVER/NNP CONTACT/NNP ME/NNP AGAIN/NNP !/. DON'T/VB YOU/PRP COME/VB NEAR/NNP MY/NNP FAMILY/NNP !/. \"/'' And/CC he/PRP threw/VBD the/DT receiver/NN back/RB onto/IN the/DT telephone/NN as/IN if/IN dropping/VBG a/DT poisonous/JJ spider/NN ./. The/DT fight/NN that/WDT had/VBD followed/VBN had/VBD been/VBN one/CD of/IN the/DT worst/JJS ever/RB ./. \"/'' HOW/NNP DARE/NNP YOU/PRP GIVE/VBP THIS/DT NUMBER/NNP TO/TO PEOPLE/NNP LIKE/NNP --/: PEOPLE/NNP LIKE/NNP YOU/PRP !/. \"/'' Uncle/NNP Vernon/NNP had/VBD roared/VBD ,/, spraying/VBG Harry/NNP with/IN spit/VB ./. Ron/NNP obviously/RB realized/VBD that/IN he/PRP 'd/MD gotten/VBN Harry/NNP into/IN trouble/NN ,/, because/IN he/PRP had/VBD n't/RB called/VBN again/RB ./. Harry/NNP 's/POS other/JJ best/JJS friend/NN from/IN Hogwarts/NNS ,/, Hermione/NNP Granger/NNP ,/, had/VBD n't/RB been/VBN in/IN touch/NN either/RB ./. Harry/NNP suspected/VBD that/IN Ron/NNP had/VBD warned/VBN Hermione/NNP not/RB to/TO call/VB ,/, which/WDT was/VBD a/DT pity/NN ,/, because/IN Hermione/NNP ,/, the/DT cleverest/NN witch/NN in/IN Harry/NNP 's/POS year/NN ,/, had/VBD Muggle/NNP parents/NNS ,/, knew/VBD perfectly/RB well/RB how/WRB to/TO use/VB a/DT telephone/NN ,/, and/CC would/MD probably/RB have/VB had/VBN enough/RB sense/NN not/RB to/TO say/VB that/IN she/PRP went/VBD to/TO Hogwarts/NNS ./. So/IN Harry/NNP had/VBD had/VBN no/DT word/NN from/IN any/DT of/IN his/PRP$ wizarding/NN friends/NNS for/IN five/CD long/JJ weeks/NNS ,/, and/CC this/DT summer/NN was/VBD turning/VBG out/RP to/TO be/VB almost/RB as/RB bad/JJ as/IN the/DT last/JJ one/CD ./. There/EX was/VBD just/RB one/CD very/RB small/JJ improvement/NN --/: after/IN swearing/VBG that/IN he/PRP would/MD n't/RB use/VB her/PRP$ to/TO send/VB letters/NNS to/TO any/DT of/IN his/PRP$ friends/NNS ,/, Harry/NNP had/VBD been/VBN allowed/VBN to/TO let/VB his/PRP$ owl/NN ,/, Hedwig/NNP ,/, out/RB at/IN night/NN ./. Uncle/NNP Vernon/NNP had/VBD given/VBN in/IN because/IN of/IN the/DT racket/NN Hedwig/NNP made/VBD if/IN she/PRP was/VBD locked/VBN in/IN her/PRP$ cage/NN all/PDT the/DT time/NN ./. Harry/NNP finished/VBD writing/VBG about/RB Wendelin/VBD the/DT Weird/NNP and/CC paused/VBD to/TO listen/VB again/RB ./. The/DT silence/NN in/IN the/DT dark/JJ house/NN was/VBD broken/VBN only/RB by/IN the/DT distant/JJ ,/, grunting/VBG snores/NNS of/IN his/PRP$ enormous/JJ cousin/NN ,/, Dudley/NNP ./. It/PRP must/MD be/VB very/RB late/JJ ,/, Harry/NNP thought/VBD ./. His/PRP$ eyes/NNS were/VBD itching/VBG with/IN tiredness/NN ./. Perhaps/RB he/PRP 'd/MD finish/VB this/DT essay/NN tomorrow/NN night/NN ..../: He/PRP replaced/VBD the/DT top/NN of/IN the/DT ink/NN bottle/NN ;/: pulled/VBD an/DT old/JJ pillowcase/NN from/IN under/IN his/PRP$ bed/NN ;/: put/VBD the/DT flashlight/NN ,/, A/DT History/NN of/IN Magic/NNP ,/, his/PRP$ essay/NN ,/, quill/RB ,/, and/CC ink/NN inside/IN it/PRP ;/: got/VBD out/IN of/IN bed/NN ;/: and/CC hid/VBN the/DT lot/NN under/IN a/DT loose/JJ floorboard/NN under/IN his/PRP$ bed/NN ./. Then/RB he/PRP stood/VBD up/RB ,/, stretched/VBD ,/, and/CC checked/VBD the/DT time/NN on/IN the/DT luminous/JJ alarm/NN clock/NN on/IN his/PRP$ bedside/NN table/NN ./. It/PRP was/VBD one/CD o'clock/RB in/IN the/DT morning/NN ./. Harry/NNP 's/POS stomach/NN gave/VBD a/DT funny/JJ jolt/NN ./. He/PRP had/VBD been/VBN thirteen/CD years/NNS old/JJ ,/, without/IN realizing/VBG it/PRP ,/, for/IN a/DT whole/JJ hour/NN ./. Yet/CC another/DT unusual/JJ thing/NN about/IN Harry/NNP was/VBD how/WRB little/JJ he/PRP looked/VBD forward/RB to/TO his/PRP$ birthdays/NNS ./. He/PRP had/VBD never/RB received/VBN a/DT birthday/NN card/NN in/IN his/PRP$ life/NN ./. The/DT Dursleys/NNPS had/VBD completely/RB ignored/VBN his/PRP$ last/JJ two/CD birthdays/NNS ,/, and/CC he/PRP had/VBD no/DT reason/NN to/TO suppose/VB they/PRP would/MD remember/VB this/DT one/NN ./. Harry/NNP walked/VBD across/IN the/DT dark/JJ room/NN ,/, past/IN Hedwig/NNP 's/POS large/JJ ,/, empty/JJ cage/NN ,/, to/TO the/DT open/JJ window/NN ./. He/PRP leaned/VBD on/IN the/DT sill/NN ,/, the/DT cool/JJ night/NN air/NN pleasant/JJ on/IN his/PRP$ face/NN after/IN a/DT long/JJ time/NN under/IN the/DT blankets/NNS ./. Hedwig/NNP had/VBD been/VBN absent/JJ for/IN two/CD nights/NNS now/RB ./. Harry/NNP was/VBD n't/RB worried/VBN about/IN her/PRP :/: she/PRP 'd/MD been/VBN gone/VBN this/DT long/JJ before/IN ./. But/CC he/PRP hoped/VBD she/PRP 'd/MD be/VB back/RB soon/RB --/: she/PRP was/VBD the/DT only/JJ living/NN creature/NN in/IN this/DT house/NN who/WP did/VBD n't/RB flinch/VB at/IN the/DT sight/NN of/IN him/PRP ./. Harry/NNP ,/, though/IN still/RB rather/RB small/JJ and/CC skinny/JJ for/IN his/PRP$ age/NN ,/, had/VBD grown/VBN a/DT few/JJ inches/NNS over/IN the/DT last/JJ year/NN ./. His/PRP$ jet-black/JJ hair/NN ,/, however/RB ,/, was/VBD just/RB as/IN it/PRP always/RB had/VBD been/VBN --/: stubbornly/RB untidy/RB ,/, whatever/WDT he/PRP did/VBD to/TO it/PRP ./. The/DT eyes/NNS behind/IN his/PRP$ glasses/NNS were/VBD bright/JJ green/JJ ,/, and/CC on/IN his/PRP$ forehead/NN ,/, clearly/RB visible/JJ through/IN his/PRP$ hair/NN ,/, was/VBD a/DT thin/JJ scar/NN ,/, shaped/VBD like/IN a/DT bolt/NN of/IN lightning/NN ./. Of/IN all/PDT the/DT unusual/JJ things/NNS about/IN Harry/NNP ,/, this/DT scar/NN was/VBD the/DT most/RBS extraordinary/JJ of/IN all/DT ./. It/PRP was/VBD not/RB ,/, as/IN the/DT Dursleys/NNPS had/VBD pretended/VBN for/IN ten/CD years/NNS ,/, a/DT souvenir/NN of/IN the/DT car/NN crash/NN that/WDT had/VBD killed/VBN Harry/NNP 's/POS parents/NNS ,/, because/IN Lily/NNP and/CC James/NNP Potter/NNP had/VBD not/RB died/VBN in/IN a/DT car/NN crash/NN ./. They/PRP had/VBD been/VBN murdered/VBN ,/, murdered/VBN by/IN the/DT most/JJS feared/VBN Dark/JJ wizard/NN for/IN a/DT hundred/CD years/NNS ,/, Lord/NNP Voldemort/NNP ./. Harry/NNP had/VBD escaped/VBN from/IN the/DT same/JJ attack/NN with/IN nothing/NN more/JJR than/IN a/DT scar/NN on/IN his/PRP$ forehead/NN ,/, where/WRB Voldemort/NNP 's/POS curse/NN ,/, instead/RB of/IN killing/VBG him/PRP ,/, had/VBD rebounded/VBN upon/IN its/PRP$ originator/NN ./. Barely/RB alive/JJ ,/, Voldemort/NNP had/VBD fled/VBN ..../: But/CC Harry/NNP had/VBD come/VBN face-to-face/RB with/IN him/PRP at/IN Hogwarts/NNS ./. Remembering/VBG their/PRP$ last/JJ meeting/NN as/IN he/PRP stood/VBD at/IN the/DT dark/JJ window/NN ,/, Harry/NNP had/VBD to/TO admit/VB he/PRP was/VBD lucky/JJ even/RB to/TO have/VB reached/VBN his/PRP$ thirteenth/JJ birthday/NN ./. He/PRP scanned/VBD the/DT starry/NN sky/NN for/IN a/DT sign/NN of/IN Hedwig/NNP ,/, perhaps/RB soaring/VBG back/RB to/TO him/PRP with/IN a/DT dead/JJ mouse/NN dangling/VBG from/IN her/PRP beak/NN ,/, expecting/VBG praise/NN ./. Gazing/VBG absently/RB over/IN the/DT rooftops/NNS ,/, it/PRP was/VBD a/DT few/JJ seconds/NNS before/IN Harry/NNP realized/VBD what/WP he/PRP was/VBD seeing/VBG ./. Silhouetted/NNP against/IN the/DT golden/JJ moon/NN ,/, and/CC growing/VBG larger/JJR every/DT moment/NN ,/, was/VBD a/DT large/JJ ,/, strangely/RB lopsided/JJ creature/NN ,/, and/CC it/PRP was/VBD flapping/VBG in/IN Harry/NNP 's/POS direction/NN ./. He/PRP stood/VBD quite/RB still/RB ,/, watching/VBG it/PRP sink/VB lower/RBR and/CC lower/RBR ./. For/IN a/DT split/JJ second/JJ he/PRP hesitated/VBD ,/, his/PRP$ hand/NN on/IN the/DT window/NN latch/NN ,/, wondering/VBG whether/IN to/TO slam/VB it/PRP shut/VB ./. But/CC then/RB the/DT bizarre/JJ creature/NN soared/VBD over/IN one/CD of/IN the/DT street/NN lamps/NNS of/IN Privet/NN Drive/NNP ,/, and/CC Harry/NNP ,/, realizing/VBG what/WP it/PRP was/VBD ,/, leapt/VBD aside/RB ./. Through/IN the/DT window/NN soared/VBD three/CD owls/NNS ,/, two/CD of/IN them/PRP holding/VBG up/RP the/DT third/JJ ,/, which/WDT appeared/VBD to/TO be/VB unconscious/JJ ./. They/PRP landed/VBD with/IN a/DT soft/JJ flump/NN on/IN Harry/NNP 's/POS bed/NN ,/, and/CC the/DT middle/JJ owl/NN ,/, which/WDT was/VBD large/JJ and/CC gray/JJ ,/, keeled/VBN right/RB over/IN and/CC lay/VBD motionless/JJ ./. There/EX was/VBD a/DT large/JJ package/NN tied/VBN to/TO its/PRP$ legs/NNS ./. Harry/NNP recognized/VBD the/DT unconscious/JJ owl/NN at/IN once/RB --/: his/PRP$ name/NN was/VBD Errol/NNP ,/, and/CC he/PRP belonged/VBD to/TO the/DT Weasley/NNP family/NN ./. Harry/NNP dashed/VBD to/TO the/DT bed/NN ,/, untied/VBD the/DT cords/NNS around/IN Errol/NNP 's/POS legs/NNS ,/, took/VBD off/RP the/DT parcel/NN ,/, and/CC then/RB carried/VBD Errol/NNP to/TO Hedwig/NNP 's/POS cage/NN ./. Errol/NNP opened/VBD one/CD bleary/JJ eye/NN ,/, gave/VBD a/DT feeble/JJ hoot/NN of/IN thanks/NNS ,/, and/CC began/VBD to/TO gulp/VB some/DT water/NN ./. Harry/NNP turned/VBD back/RB to/TO the/DT remaining/VBG owls/NNS ./. One/CD of/IN them/PRP ,/, the/DT large/JJ snowy/JJ female/NN ,/, was/VBD his/PRP$ own/JJ Hedwig/NNP ./. She/PRP ,/, too/RB ,/, was/VBD carrying/VBG a/DT parcel/NN and/CC looked/VBD extremely/RB pleased/JJ with/IN herself/PRP ./. She/PRP gave/VBD Harry/NNP an/DT affectionate/JJ nip/NN with/IN her/PRP$ beak/NN as/IN he/PRP removed/VBD her/PRP$ burden/NN ,/, then/RB flew/VBD across/IN the/DT room/NN to/TO join/VB Errol/NNP ./. Harry/NNP did/VBD n't/RB recognize/VB the/DT third/JJ owl/NN ,/, a/DT handsome/JJ tawny/JJ one/NN ,/, but/CC he/PRP knew/VBD at/IN once/RB where/WRB it/PRP had/VBD come/VBN from/IN ,/, because/IN in/IN addition/NN to/TO a/DT third/JJ package/NN ,/, it/PRP was/VBD carrying/VBG a/DT letter/NN bearing/VBG the/DT Hogwarts/NNS crest/NN ./. When/WRB Harry/NNP relieved/VBD this/DT owl/NN of/IN its/PRP$ burden/NN ,/, it/PRP ruffled/VBD its/PRP$ feathers/NNS importantly/RB ,/, stretched/VBD its/PRP$ wings/NNS ,/, and/CC took/VBD off/RP through/IN the/DT window/NN into/IN the/DT night/NN ./. Harry/NNP sat/VBD down/RB on/IN his/PRP$ bed/NN and/CC grabbed/VBD Errol/NNP 's/POS package/NN ,/, ripped/VBD off/RP the/DT brown/JJ paper/NN ,/, and/CC discovered/VBD a/DT present/JJ wrapped/VBN in/IN gold/NN ,/, and/CC his/PRP$ first/JJ ever/RB birthday/NN card/NN ./. Fingers/NNP trembling/VBG slightly/RB ,/, he/PRP opened/VBD the/DT envelope/NN ./. Two/CD pieces/NNS of/IN paper/NN fell/VBD out/RB --/: a/DT letter/NN and/CC a/DT newspaper/NN clipping/NN ./. The/DT clipping/NN had/VBD clearly/RB come/VBN out/IN of/IN the/DT wizarding/JJ newspaper/NN ,/, the/DT Daily/NNP Prophet/NNP ,/, because/IN the/DT people/NNS in/IN the/DT black-and-white/JJ picture/NN were/VBD moving/VBG ./. Harry/NNP picked/VBD up/RP the/DT clipping/NN ,/, smoothed/VBD it/PRP out/RP ,/, and/CC read/VBD :/: MINISTRY/NN OF/IN MAGIC/NNP EMPLOYEE/NN SCOOPS/NNP GRAND/NNP PRIZE/NNP Arthur/NNP Weasley/NNP ,/, Head/NNP of/IN the/DT Misuse/NNP of/IN Muggle/NNP Artifacts/NNP Office/NNP at/IN the/DT Ministry/NNP of/IN Magic/NNP ,/, has/VBZ won/VBN the/DT annual/JJ Daily/NNP Prophet/NNP Grand/NNP Prize/NNP Galleon/NNP Draw/NNP ./. A/DT delighted/JJ Mr./NNP Weasley/NNP told/VBD the/DT Daily/NNP Prophet/NNP ,/, \"/`` We/PRP will/MD be/VB spending/VBG the/DT gold/NN on/IN a/DT summer/NN holiday/NN in/IN Egypt/NNP ,/, where/WRB our/PRP$ eldest/JJS son/NN ,/, Bill/NNP ,/, works/VBZ as/IN a/DT curse/NN breaker/NN for/IN Gringotts/NNP Wizarding/NNP Bank/NNP ./. \"/'' The/DT Weasley/NNP family/NN will/MD be/VB spending/VBG a/DT month/NN in/IN Egypt/NNP ,/, returning/VBG for/IN the/DT start/NN of/IN the/DT new/JJ school/NN year/NN at/IN Hogwarts/NNS ,/, which/WDT five/CD of/IN the/DT Weasley/NNP children/NNS currently/RB attend/VBP ./. Harry/NNP scanned/VBD the/DT moving/VBG photograph/NN ,/, and/CC a/DT grin/NN spread/NN across/IN his/PRP$ face/NN as/IN he/PRP saw/VBD all/DT nine/CD of/IN the/DT Weasleys/NNP waving/VBG furiously/RB at/IN him/PRP ,/, standing/VBG in/IN front/NN of/IN a/DT large/JJ pyramid/NN ./. Plump/VB little/JJ Mrs./NNP Weasley/NNP ;/: tail/NN ,/, balding/VBG Mr./NNP Weasley/NNP ;/: six/CD sons/NNS ;/: and/CC one/CD daughter/NN ,/, all/DT (/-LRB- though/IN the/DT black-and-white/JJ picture/NN did/VBD n't/RB show/VB it/PRP )/-RRB- with/IN flaming-red/JJ hair/NN ./. Right/RB in/IN the/DT middle/NN of/IN the/DT picture/NN was/VBD Ron/NNP ,/, tall/JJ and/CC gangling/NN ,/, with/IN his/PRP$ pet/JJ rat/NN ,/, Scabbers/NNP ,/, on/IN his/PRP$ shoulder/NN and/CC his/PRP$ arm/NN around/IN his/PRP$ little/JJ sister/NN ,/, Ginny/NNP ./. Harry/NNP could/MD n't/RB think/VB of/IN anyone/NN who/WP deserved/VBD to/TO win/VB a/DT large/JJ pile/NN of/IN gold/NN more/RBR than/IN the/DT Weasleys/NNP ,/, who/WP were/VBD very/RB nice/JJ and/CC extremely/RB poor/JJ ./. He/PRP picked/VBD up/RP Ron/NNP 's/POS letter/NN and/CC unfolded/VBD it/PRP ./. Dear/NNP Harry/NNP ,/, Happy/NNP birthday/NN !/. Look/VB ,/, I/PRP '/'' really/RB sorry/JJ about/IN that/DT telephone/NN call/NN ./. I/PRP hope/VBP the/DT Muggles/NNS did/VBD n't/RB give/VB you/PRP a/DT hard/JJ time/NN ./. I/PRP asked/VBD Dad/NNP ,/, and/CC he/PRP reckons/VBZ I/PRP should/MD n't/RB have/VB shouted/VBN ./. It/PRP 's/VBZ amazing/JJ here/RB in/IN Egypt/NNP ./. Bill/NNP 's/POS taken/VBN us/PRP around/IN all/DT the/DT tombs/NNS and/CC you/PRP would/MD n't/RB believe/VB the/DT curses/NNS those/DT old/JJ Egyptian/JJ wizards/NNS put/VBD on/IN them/PRP ./. Mum/NNP would/MD n't/RB let/VB Ginny/NNP come/VB in/IN the/DT last/JJ one/CD ./. There/EX were/VBD all/DT these/DT mutant/JJ skeletons/NNS in/IN there/RB ,/, of/IN Muggles/NNS who/WP 'd/MD broken/VBN in/IN and/CC grown/JJ extra/JJ heads/NNS and/CC stuff/NN ./. I/PRP could/MD n't/RB believe/VB it/PRP when/WRB Dad/NNP won/VBD the/DT Daily/NNP Prophet/NNP Draw/NNP ./. Seven/CD hundred/CD galleons/NNS !/. Most/JJS of/IN it/PRP 's/VBZ gone/VBN on/IN this/DT trip/NN ,/, but/CC they/PRP 're/VBP going/VBG to/TO buy/VB me/PRP a/DT new/JJ wand/NN for/IN next/JJ year/NN ./. Harry/NNP remembered/VBD only/RB too/RB well/RB the/DT occasion/NN when/WRB Ron/NNP 's/POS old/JJ wand/NN had/VBD snapped/VBN ./. It/PRP had/VBD happened/VBN when/WRB the/DT car/NN the/DT two/CD of/IN them/PRP had/VBD been/VBN flying/VBG to/TO Hogwarts/NNS had/VBD crashed/VBN into/IN a/DT tree/NN on/IN the/DT school/NN grounds/NNS ./. We/PRP 'll/MD be/VB back/RB about/IN a/DT week/NN before/IN term/NN starts/NNS and/CC we/PRP 'll/MD be/VB going/VBG up/RP to/TO London/NNP to/TO get/VB my/PRP$ wand/NN and/CC our/PRP$ new/JJ books/NNS ./. Any/DT chance/NN of/IN meeting/NN you/PRP there/RB ?/. Do/VB n't/RB let/VB the/DT Muggles/NNS get/VBP you/PRP down/RB !/. Try/VB and/CC come/VB to/TO London/NNP ,/, Ron/NNP P.S./NNP Percy/NNP 's/POS Head/NNP Boy/NN ./. He/PRP got/VBD the/DT letter/NN last/JJ week/NN ./. Harry/NNP glanced/VBD back/RB at/IN the/DT photograph/NN ./. Percy/NNP ,/, who/WP was/VBD in/IN his/PRP$ seventh/JJ and/CC final/JJ year/NN at/IN Hogwarts/NNS ,/, was/VBD looking/VBG particularly/RB smug./JJ He/PRP had/VBD pinned/VBN his/PRP$ Head/NN Boy/NN badge/NN to/TO the/DT fez/NNS perched/VBN jauntily/RB on/IN top/NN of/IN his/PRP$ neat/JJ hair/NN ,/, his/PRP$ horn-rimmed/JJ glasses/NNS flashing/VBG in/IN the/DT Egyptian/JJ sun/NN ./. Harry/NNP now/RB turned/VBD to/TO his/PRP$ present/JJ and/CC unwrapped/JJ it/PRP ./. Inside/NNP was/VBD what/WP looked/VBD like/IN a/DT miniature/NN glass/NN spinning/VBG top/RB ./. There/EX was/VBD another/DT note/NN from/IN Ron/NNP beneath/IN it/PRP ./. Harry/NNP --/: this/DT is/VBZ a/DT Pocket/NNP Sneakoscope/NNP ./. If/IN there/EX 's/VBZ someone/NN untrustworthy/JJ around/IN ,/, it/PRP 's/VBZ supposed/VBN to/TO light/VB up/RP and/CC spin/VB ./. Bill/NNP says/VBZ it/PRP 's/VBZ rubbish/JJ sold/VBD for/IN wizard/JJ tourists/NNS and/CC is/VBZ n't/RB reliable/JJ ,/, because/IN it/PRP kept/VBD lighting/VBG up/RP at/IN dinner/NN last/JJ night/NN ./. But/CC he/PRP did/VBD n't/RB realize/VB Fred/NNP and/CC George/NNP had/VBD put/VBN beetles/NNS in/IN his/PRP$ soup/NN ./. Bye/'' --/: Ron/NNP Harry/NNP put/VBD the/DT Pocket/NNP Sneakoscope/NNP on/IN his/PRP$ bedside/NN table/NN ,/, where/WRB it/PRP stood/VBD quite/RB still/RB ,/, balanced/VBN on/IN its/PRP$ point/NN ,/, reflecting/VBG the/DT luminous/JJ hands/NNS of/IN his/PRP$ clock/NN ./. He/PRP looked/VBD at/IN it/PRP happily/RB for/IN a/DT few/JJ seconds/NNS ,/, then/RB picked/VBD up/RP the/DT parcel/NN Hedwig/NNP had/VBD brought/VBN ./. Inside/IN this/DT ,/, too/RB ,/, there/EX was/VBD a/DT wrapped/VBN present/NN ,/, a/DT card/NN ,/, and/CC a/DT letter/NN ,/, this/DT time/NN from/IN Hermione/NNP ./. Dear/NNP Harry/NNP ,/, Ron/NNP wrote/VBD to/TO me/PRP and/CC told/VBD me/PRP about/IN his/PRP$ phone/NN call/NN to/TO your/PRP$ Uncle/NNP Vernon/NNP ./. I/PRP do/VBP hope/VB you/PRP 're/VBP all/DT right/JJ ./. I/PRP 'm/VBP on/IN holiday/NN in/IN France/NNP at/IN the/DT moment/NN and/CC I/PRP did/VBD n't/RB know/VB how/WRB I/PRP was/VBD going/VBG to/TO send/VB this/DT to/TO you/PRP --/: what/WP if/IN they/PRP 'd/MD opened/VBD it/PRP at/IN customs/NNS ?/. --/: but/CC then/RB Hedwig/NNP turned/VBD up/RP !/. I/PRP think/VBP she/PRP wanted/VBD to/TO make/VB sure/JJ you/PRP got/VBD something/NN for/IN your/PRP$ birthday/NN for/IN a/DT change/NN ./. I/PRP bought/VBD your/PRP$ present/JJ by/IN owl-order/NN ;/: there/EX was/VBD an/DT advertisement/NN in/IN the/DT Daily/NNP Prophet/NNP (/-LRB- I/PRP 've/VBP been/VBN getting/VBG it/PRP delivered/VBN ;/: it/PRP 's/VBZ so/RB good/JJ to/TO keep/VB up/RP with/IN what/WP 's/VBZ going/VBG on/RP in/IN the/DT wizarding/JJ world/NN )/-RRB- ,/, Did/VBD you/PRP see/VB that/DT picture/NN of/IN Ron/NNP and/CC his/PRP$ family/NN a/DT week/NN ago/RB ?/. I/PRP bet/VBD he/PRP 's/VBZ learning/VBG loads/NNS ./. I/PRP 'm/VBP really/RB jealous/JJ --/: the/DT ancient/JJ Egyptian/JJ wizards/NNS were/VBD fascinating/JJ ./. There/EX 's/VBZ some/DT interesting/JJ local/JJ history/NN of/IN witchcraft/NN here/RB ,/, too/RB ./. I/PRP 've/VBP rewritten/VBN my/PRP$ whole/JJ History/NN of/IN Magic/NNP essay/NN to/TO include/VB some/DT of/IN the/DT things/NNS I/PRP 've/VBP found/VBN out/RP ,/, I/PRP hope/VBP it/PRP 's/VBZ not/RB too/RB long/JJ --/: it/PRP 's/VBZ two/CD rolls/NNS of/IN parchment/NN more/RBR than/IN Professor/NNP Binns/NNP asked/VBD for/IN ./. Ron/NNP says/VBZ he/PRP 's/VBZ going/VBG to/TO be/VB in/IN London/NNP in/IN the/DT last/JJ week/NN of/IN the/DT holidays/NNS ./. Can/MD you/PRP make/VB it/PRP ?/. Will/MD your/PRP$ aunt/NN and/CC uncle/NN let/VB you/PRP come/VB ?/. I/PRP really/RB hope/VBP you/PRP can/MD ./. If/IN not/RB ,/, I/PRP 'll/MD see/VB you/PRP on/IN the/DT Hogwarts/NNS Express/NNP on/IN September/NNP first/JJ !/. Love/VB from/IN Hermione/NNP P.S./NNP Ron/NNP says/VBZ Percy/NNP 's/POS Head/NNP Boy/NNP ./. I/PRP 'll/MD bet/VB Percy/NNP 's/POS really/RB pleased/JJ Ron/NNP does/VBZ n't/RB seem/VB too/RB happy/JJ about/IN it/PRP Harry/NNP laughed/VBD as/IN he/PRP put/VBD Herrmone/NNP 's/POS letter/NN aside/RB and/CC picked/VBD up/RP her/PRP$ present/JJ ./. It/PRP was/VBD very/RB heavy/JJ ./. Knowing/NNP Hermione/NNP ,/, he/PRP was/VBD sure/JJ it/PRP would/MD be/VB a/DT large/JJ book/NN full/JJ of/IN very/RB difficult/JJ spells/NNS --/: but/CC it/PRP was/VBD n't/RB ./. His/PRP$ heart/NN gave/VBD a/DT huge/JJ bound/JJ as/IN he/PRP ripped/VBD back/RP the/DT paper/NN and/CC saw/VBD a/DT sleek/JJ black/JJ leather/NN case/NN ,/, with/IN silver/JJ words/NNS stamped/VBD across/IN it/PRP ,/, reading/VBG Broomstick/NNP Servicing/NNP Kit/NN ./. \"/'' Wow/UH ,/, Hermione/NNP !/. \"/'' Harry/NNP whispered/VBD ,/, unzipping/VBG the/DT case/NN to/TO look/VB inside/RB ./. There/EX was/VBD a/DT large/JJ jar/NN of/IN Fleetwood/NNP 's/POS High-Finish/JJ Handle/NNP Polish/NNP ,/, a/DT pair/NN of/IN gleaming/VBG silver/JJ Tall-Twig/JJ Clippers/NNS ,/, a/DT tiny/JJ brass/NN compass/NN to/TO clip/VB on/IN your/PRP$ broom/NN for/IN long/JJ journeys/NNS ,/, and/CC a/DT Handbook/NN of/IN Do-It-Yourself/NNP Broomcare/NNP ./. Apart/RB from/IN his/PRP$ friends/NNS ,/, the/DT thing/NN that/IN Harry/NNP missed/VBD most/RBS about/IN Hogwarts/NNS was/VBD Quidditch/NNP ,/, the/DT most/RBS popular/JJ sport/NN in/IN the/DT magical/JJ world/NN --/: highly/RB dangerous/JJ ,/, very/RB exciting/JJ ,/, and/CC played/VBD on/IN broomsticks/NNS ./. Harry/NNP happened/VBD to/TO be/VB a/DT very/RB good/JJ Quidditch/NNP player/NN ;/: he/PRP had/VBD been/VBN the/DT youngest/JJS person/NN in/IN a/DT century/NN to/TO be/VB picked/VBN for/IN one/CD of/IN the/DT Hogwarts/NNS House/NNP teams/NNS ./. One/CD of/IN Harry/NNP 's/POS most/RBS prized/JJ possessions/NNS was/VBD his/PRP$ Nimbus/NNP Two/CD Thousand/NNP racing/NN broom/NN ./. Harry/NNP put/VBD the/DT leather/NN case/NN aside/RB and/CC picked/VBD up/RP his/PRP$ last/JJ parcel/NN ./. He/PRP recognized/VBD the/DT untidy/NNP scrawl/NN on/IN the/DT brown/JJ paper/NN at/IN once/RB :/: this/DT was/VBD from/IN Hagrid/NNP ,/, the/DT Hogwarts/NNS gamekeeper/NN ./. He/PRP tore/VBD off/RP the/DT top/JJ layer/NN of/IN paper/NN and/CC glimpsed/VBD something/NN green/JJ and/CC leathery/NN ,/, but/CC before/IN he/PRP could/MD unwrap/VB it/PRP properly/RB ,/, the/DT parcel/NN gave/VBD a/DT strange/JJ quiver/NN ,/, and/CC whatever/WDT was/VBD inside/IN it/PRP snapped/VBD loudly/RB --/: as/IN though/IN it/PRP had/VBD jaws/NNS ./. Harry/NNP froze/VBD ./. He/PRP knew/VBD that/IN Hagrid/NNP would/MD never/RB send/VB him/PRP anything/NN dangerous/JJ on/IN purpose/NN ,/, but/CC then/RB ,/, Hagrid/NNP did/VBD n't/RB have/VB a/DT normal/JJ person/NN 's/POS view/NN of/IN what/WP was/VBD dangerous/JJ ./. Hagrid/NNP had/VBD been/VBN known/VBN to/TO befriend/VB giant/JJ spiders/NNS ,/, buy/VB vicious/JJ ,/, three-headed/JJ dogs/NNS from/IN men/NNS in/IN pubs/NNS ,/, and/CC sneak/VB illegal/JJ dragon/NN eggs/NNS into/IN his/PRP$ cabin/NN ./. Harry/NNP poked/VBD the/DT parcel/NN nervously/RB ./. It/PRP snapped/VBD loudly/RB again/RB ./. Harry/NNP reached/VBD for/IN the/DT lamp/NN on/IN his/PRP$ bedside/NN table/NN ,/, gripped/VBD it/PRP firmly/RB in/IN one/CD hand/NN ,/, and/CC raised/VBD it/PRP over/IN his/PRP$ head/NN ,/, ready/JJ to/TO strike/VB ./. Then/RB he/PRP seized/VBD the/DT rest/NN of/IN the/DT wrapping/VBG paper/NN in/IN his/PRP$ other/JJ hand/NN and/CC pulled/VBD ./. And/CC out/IN fell/VBD --/: a/DT book/NN ./. Harry/NNP just/RB had/VBD time/NN to/TO register/VB its/PRP$ handsome/JJ green/JJ cover/NN ,/, emblazoned/VBN with/IN the/DT golden/JJ title/NN The/DT Monster/NNP Book/NNP of/IN Monsters/NNP ,/, before/IN it/PRP flipped/VBD onto/IN its/PRP$ edge/NN and/CC scuttled/VBD sideways/RB along/IN the/DT bed/NN like/IN some/DT weird/JJ crab/NN ./. \"/'' Uh-oh/UH ,/, \"/'' Harry/NNP muttered/VBD ./. The/DT book/NN toppled/VBD off/IN the/DT bed/NN with/IN a/DT loud/JJ clunk/NN and/CC shuffled/VBD rapidly/RB across/IN the/DT room/NN ./. Harry/NNP followed/VBD it/PRP stealthily/RB ./. The/DT book/NN was/VBD hiding/VBG in/IN the/DT dark/JJ space/NN under/IN his/PRP$ desk/NN ./. Praying/NN that/IN the/DT Dursleys/NNPS were/VBD still/RB fast/RB asleep/RB ,/, Harry/NNP got/VBD down/RP on/IN his/PRP$ hands/NNS and/CC knees/NNS and/CC reached/VBD toward/IN it/PRP ./. \"/'' Ouch/RB !/. \"/'' The/DT book/NN snapped/VBD shut/VBN on/IN his/PRP$ hand/NN and/CC then/RB flapped/VBD past/IN him/PRP ,/, still/RB scuttling/VBG on/IN its/PRP$ covers/NNS ./. Harry/NNP scrambled/VBD around/RB ,/, threw/VBD himself/PRP forward/RB ,/, and/CC managed/VBD to/TO flatten/VB it/PRP ./. Uncle/NNP Vernon/NNP gave/VBD a/DT loud/JJ ,/, sleepy/JJ grunt/NN in/IN the/DT room/NN next/JJ door/NN ./. Hedwig/'' and/CC Errol/NNP watched/VBD interestedly/RB as/IN Harry/NNP clamped/VBD the/DT struggling/JJ book/NN tightly/RB in/IN his/PRP$ arms/NNS ,/, hurried/VBD to/TO his/PRP$ chest/NN of/IN drawers/NNS ,/, and/CC pulled/VBD out/RP a/DT belt/NN ,/, which/WDT he/PRP buckled/VBD tightly/RB around/IN it/PRP ./. The/DT Monster/NNP Book/NNP shuddered/VBD angrily/RB ,/, but/CC could/MD no/RB longer/RB flap/VB and/CC snap/VB ,/, so/IN Harry/NNP threw/VBD it/PRP down/RP on/IN the/DT bed/NN and/CC reached/VBD for/IN Hagrid/NNP 's/POS card/NN ./. Dear/NNP Harry/NNP ,/, Happy/NNP Birthday/NNP !/. Think/VB you/PRP might/MD find/VB this/DT useful/JJ for/IN next/JJ year/NN ./. Won't/NNP say/VBP no/DT more/JJR here/RB ./. Tell/VB you/PRP when/WRB I/PRP see/VBP you/PRP ./. Hope/VB the/DT Muggles/NNS are/VBP treating/VBG you/PRP right/NN ./. All/PDT the/DT best/JJS ,/, Hagrid/NNP It/PRP struck/VBD Harry/NNP as/IN ominous/JJ that/IN Hagrid/NNP thought/VBD a/DT biting/JJ book/NN would/MD come/VB in/IN useful/JJ ,/, but/CC he/PRP put/VBD Hagrid/NNP 's/POS card/NN up/RP next/IN to/TO Ron/NNP 's/POS and/CC Hermione/NNP 's/POS ,/, grinning/VBG more/RBR broadly/RB than/IN ever/RB ./. Now/RB there/EX was/VBD only/RB the/DT letter/NN from/IN Hogwarts/NNS left/VBN ./. Noticing/VBG that/IN it/PRP was/VBD rather/RB thicker/JJR than/IN usual/JJ ,/, Harry/NNP slit/VB open/VB the/DT envelope/NN ,/, pulled/VBD out/RP the/DT first/JJ page/NN of/IN parchment/NN within/IN ,/, and/CC read/VBD :/: Dear/NNP Mr./NNP Potter/NNP ,/, Please/VB note/NN that/IN the/DT new/JJ school/NN year/NN will/MD begin/VB on/IN September/NNP the/DT first/JJ ./. The/DT Hogwarts/NNP Express/NNP will/MD leave/VB ftom/IN King/NNP 's/POS Cross/NNP station/NN ,/, platform/NN nine/CD and/CC three-quarters/NNS ,/, at/IN eleven/CD o'clock/RB ./. Third/JJ years/NNS are/VBP permitted/VBN to/TO visit/VB the/DT village/NN of/IN Hogsmeade/NNP on/IN certain/JJ weekends/NNS ./. Please/VB give/VB the/DT enclosed/VBN permission/NN form/NN to/TO your/PRP$ parent/NN or/CC guardian/NN to/TO sign/VB ./. A/DT list/NN of/IN books/NNS for/IN next/JJ year/NN is/VBZ enclosed/VBN ./. Yours/PRP sincerely/RB ,/, Professor/NNP M./NNP McGonagall/NNP Deputy/NNP Headmistress/NNP Harry/NNP pulled/VBD out/RP the/DT Hogsmeade/JJ permission/NN form/NN and/CC looked/VBD at/IN it/PRP ,/, no/RB longer/RB grinning/VBG ./. It/PRP would/MD be/VB wonderful/JJ to/TO visit/VB Hogsmeade/NNP on/IN weekends/NNS ;/: he/PRP knew/VBD it/PRP was/VBD an/DT entirely/RB wizarding/JJ village/NN ,/, and/CC he/PRP had/VBD never/RB set/VBN foot/NN there/EX ./. But/CC how/WRB on/IN earth/NN was/VBD he/PRP going/VBG to/TO persuade/VB Uncle/NNP Vernon/NNP or/CC Aunt/NNP Petunia/NNP to/TO sign/VB the/DT form/NN ?/. He/PRP looked/VBD over/IN at/IN the/DT alarm/NN clock/NN ./. It/PRP was/VBD now/RB two/CD o'clock/RB in/IN the/DT morning/NN ./. Deciding/VBG that/IN he/PRP 'd/MD worry/VB about/IN the/DT Hogsmeade/NNP form/NN when/WRB he/PRP woke/VBD up/RP ,/, Harry/NNP got/VBD back/RB into/IN bed/NN and/CC reached/VBD up/RB to/TO cross/VB off/RP another/DT day/NN on/IN the/DT chart/NN he/PRP 'd/VBD made/VBN for/IN himself/PRP ,/, counting/VBG down/RB the/DT days/NNS left/VBD until/IN his/PRP$ return/NN to/TO Hogwarts/NNS ./. Then/RB he/PRP took/VBD off/RP his/PRP$ glasses/NNS and/CC lay/VBD down/RP ,/, eyes/NNS open/JJ ,/, facing/VBG his/PRP$ three/CD birthday/NN cards/NNS ./. Extremely/RB unusual/JJ though/IN he/PRP was/VBD ,/, at/IN that/DT moment/NN Harry/NNP Potter/NNP felt/VBD just/RB like/IN everyone/NN else/RB --/: glad/JJ ,/, for/IN the/DT first/JJ time/NN in/IN his/PRP$ life/NN ,/, that/IN it/PRP was/VBD his/PRP$ birthday/NN ./."
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
tag_pos(prisoner_of_azkaban[1]) %>% plot()

## The most common part is NN, the top two most common parts of the chapter are NN and IN.

penn_tags()
##    Tag  Description                                 
## 1  $    dollar                                      
## 2  ``   opening quotation mark                      
## 3  ''   closing quotation mark                      
## 4  (    opening parenthesis                         
## 5  )    closing parenthesis                         
## 6  ,    comma                                       
## 7  -    dash                                        
## 8  .    sentence terminator                         
## 9  :    colon or ellipsis                           
## 10 CC   conjunction, coordinating                   
## 11 CD   numeral, cardinal                           
## 12 DT   determiner                                  
## 13 EX   existential there                           
## 14 FW   foreign word                                
## 15 IN   preposition or conjunction, subordinating   
## 16 JJ   adjective or numeral, ordinal               
## 17 JJR  adjective, comparative                      
## 18 JJS  adjective, superlative                      
## 19 LS   list item marker                            
## 20 MD   modal auxiliary                             
## 21 NN   noun, common, singular or mass              
## 22 NNP  noun, proper, singular                      
## 23 NNPS noun, proper, plural                        
## 24 NNS  noun, common, plural                        
## 25 PDT  pre-determiner                              
## 26 POS  genitive marker                             
## 27 PRP  pronoun, personal                           
## 28 PRP$ pronoun, possessive                         
## 29 RB   adverb                                      
## 30 RBR  adverb, comparative                         
## 31 RBS  adverb, superlative                         
## 32 RP   particle                                    
## 33 SYM  symbol                                      
## 34 TO   "to" as preposition or infinitive marker    
## 35 UH   interjection                                
## 36 VB   verb, base form                             
## 37 VBD  verb, past tense                            
## 38 VBG  verb, present participle or gerund          
## 39 VBN  verb, past participle                       
## 40 VBP  verb, present tense, not 3rd person singular
## 41 VBZ  verb, present tense, 3rd person singular    
## 42 WDT  WH-determiner                               
## 43 WP   WH-pronoun                                  
## 44 WP$  WH-pronoun, possessive                      
## 45 WRB  Wh-adverb
tag_pos(prisoner_of_azkaban [1]) %>% as_universal() %>% plot()

RDR POS Tagger

library(RDRPOSTagger)
models <- rdr_available_models()
models
## Riple down Rule based available taggers:
## ----------------------------------------
## 
## 1/ POS tagging for languages:
## English, French, German, Hindi, Italian, Thai, Vietnamese
## 
## 2/ MORPH tagging for languages:
## Bulgarian, Czech, Dutch, French, German, Portuguese, Spanish, Swedish
## 
## 3/ UniversalPOS tagging for languages:
## Ancient_Greek-PROIEL, Ancient_Greek, Arabic, Basque, Belarusian, Bulgarian, Catalan, Chinese, Coptic, Croatian, Czech-CAC, Czech-CLTT, Czech, Danish, Dutch-LassySmall, Dutch, English-LinES, English-ParTUT, English, Estonian, Finnish-FTB, Finnish, French-ParTUT, French-Sequoia, French, Galician-TreeGal, Galician, German, Gothic, Greek, Hebrew, Hindi, Hungarian, Indonesian, Irish, Italian-ParTUT, Italian, Japanese, Korean, Latin-ITTB, Latin-PROIEL, Latin, Latvian, Lithuanian, Norwegian-Bokmaal, Norwegian-Nynorsk, Old_Church_Slavonic, Persian, Polish, Portuguese-BR, Portuguese, Romanian, Russian-SynTagRus, Russian, Slovak, Slovenian-SST, Slovenian, Spanish-AnCora, Spanish, Swedish-LinES, Swedish, Tamil, Turkish, Urdu, Vietnamese
#create_tagger<- rdr_model(language = "English", annotation = "POS")
#rdr_pos(create_tagger, x = prisoner_of_azkaban[1])

spaCy

##python chunk
import spacy
import pandas as pd


#tagged_prisoner_of_azkaban[1] = nlp(prisoner_of_azkaban[1])
#for word in tagged_sentence:
#  print(word.text, word.pos_, word.tag_)

Training your own tagger

##python chunk
import nltk
nltk.download('brown')
## True
from nltk.corpus import brown
default_tagger = nltk.DefaultTagger('NN')
tokens = brown.words(categories = "news") 
pd.DataFrame(default_tagger.tag(tokens)).head
## <bound method NDFrame.head of              0   1
## 0          The  NN
## 1       Fulton  NN
## 2       County  NN
## 3        Grand  NN
## 4         Jury  NN
## ...        ...  ..
## 100549       ,  NN
## 100550    read  NN
## 100551      ''  NN
## 100552       !  NN
## 100553       !  NN
## 
## [100554 rows x 2 columns]>
brown_tagged_sents = brown.tagged_sents()

default_tagger.evaluate(brown_tagged_sents)
## 0.13130472824476916

Unigram Tagger

##python chunk
##python chunk
##create a unigram tagger function 
unigram_tagger = nltk.UnigramTagger(brown_tagged_sents)
##lets see what it does 
unigram_tagger.tag(tokens)[:50]
## [('The', 'AT'), ('Fulton', 'NP-TL'), ('County', 'NN-TL'), ('Grand', 'JJ-TL'), ('Jury', 'NN-TL'), ('said', 'VBD'), ('Friday', 'NR'), ('an', 'AT'), ('investigation', 'NN'), ('of', 'IN'), ("Atlanta's", 'NP$'), ('recent', 'JJ'), ('primary', 'JJ'), ('election', 'NN'), ('produced', 'VBN'), ('``', '``'), ('no', 'AT'), ('evidence', 'NN'), ("''", "''"), ('that', 'CS'), ('any', 'DTI'), ('irregularities', 'NNS'), ('took', 'VBD'), ('place', 'NN'), ('.', '.'), ('The', 'AT'), ('jury', 'NN'), ('further', 'RBR'), ('said', 'VBD'), ('in', 'IN'), ('term-end', 'NN'), ('presentments', 'NNS'), ('that', 'CS'), ('the', 'AT'), ('City', 'NN-TL'), ('Executive', 'JJ-TL'), ('Committee', 'NN-TL'), (',', ','), ('which', 'WDT'), ('had', 'HVD'), ('over-all', 'JJ'), ('charge', 'NN'), ('of', 'IN'), ('the', 'AT'), ('election', 'NN'), (',', ','), ('``', '``'), ('deserves', 'VBZ'), ('the', 'AT'), ('praise', 'NN')]

Evaluate

##python chunk
unigram_tagger.evaluate(brown_tagged_sents)
## 0.9245482228606466

Apply to Harry Potter

##python chunk

Compare Results