tagger

https://github.com/trinker/tagger

# 必要なパッケージをインストール

install.packages("pacman")
pacman::p_load_gh(c(
    "trinker/termco", 
    "trinker/coreNLPsetup",        
    "trinker/tagger"
))

install.packages('rJava')
library(dplyr)
## 
##  次のパッケージを付け加えます: 'dplyr'
##  以下のオブジェクトは 'package:stats' からマスクされています: 
## 
##      filter, lag
##  以下のオブジェクトは 'package:base' からマスクされています: 
## 
##      intersect, setdiff, setequal, union
library(tagger)

library(rJava)
penn_tags()      # Penn Tree Bank のPOSタグの説明表示
##    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
penn_tags <- 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
write.table(penn_tags, "penn_tags.txt")

ためしに、品詞タグをつけてみる

ns502 <- scan("ns502only.txt", what="char", sep="\n")

ns502            # ns502.txtから、本文の文のみを取り出したデータ
##  [1] "Considering the heightened role maintained by many in education, it's strangely rare to fin many willing to question this status quo."                                                                                                                                                                                        
##  [2] "Of course, many aware of the dynamic contrast between student and teacher are perfectly willing to perpetuate and even strengthen this relationship."                                                                                                                                                                         
##  [3] "It may seem entirely silly, even, to consider that anything needs to be changed."                                                                                                                                                                                                                                             
##  [4] "However, with growing competition in workplaces and with newer jobs being developed on a regular basis, it may be necessary to reexamine this two-dimensional hierarchy in order to better prepare students for the changing world."                                                                                          
##  [5] "For years, American schools have maintained a strict adherence to an invisible, ghostly code, one that encourages respect and honor in a manner reminiscent of both the power structure found in factories and the military."                                                                                                 
##  [6] "Of course, American schools don't echo this tendency nearly as intensely as those found in Japan, but the elementary through high school experience is one defined by an old-fashioned methodology."                                                                                                                          
##  [7] "Teachers are called by their last name, friendliness is discouraged, and contact, above all else, is highly feared."                                                                                                                                                                                                          
##  [8] "And yet, all of this changes once Americans enter universities, where the professor-student roles often evaporate, save for the minority of more conservative circumstances."                                                                                                                                                 
##  [9] "Many professors are willing to acknowledge that their students have long since passed the line into adulthood and are willing to share their normal array of social tendencies with them."                                                                                                                                    
## [10] "It's not uncommon for professors to invite students out for drinks to discuss course material, or even to engage in openly accepted romantic relationships."                                                                                                                                                                  
## [11] "To many foreigners studying in America, this may seem wildly anarchistic and highly vulnerable to abuse."                                                                                                                                                                                                                     
## [12] "Whenever I tell stories of professor-student relationships to French students, especially, their first reaction is to assume that this means many professors must abuse this open attitude to gain \\\"special favors\\\" in return for favoritism."                                                                          
## [13] "While I can't, of course, claim that the chances of this occurring are nested at a safe zero percent, I can say that this attitude stems more from professors' willingness to see their students as intellectual equals."                                                                                                     
## [14] "So why, then, are we leaving our students so unprepared for such an atmosphere?"                                                                                                                                                                                                                                              
## [15] "Perhaps it's because grade school teachers are so far removed from the college experience that they've forgotten, or perhaps proceeded, the loose roles found in the college setting."                                                                                                                                        
## [16] "Speaking from experience, I can absolutely say that I'm far more eager to engage with material when the voice educating me treats me like a sentient, thinking individual, and not just a sieve or receptor ready to accept input but offer no active response."                                                              
## [17] "Students are not merely plants to be grown but people to be challenged and to challenge, and the first step to instituting this change in the educational environment is to stop the formalities and create teaching atmospheres in which students are welcome to interact with the teachers from a common, shared viewpoint."
## [18] "Now this is not to say that teachers need to abandon authority."                                                                                                                                                                                                                                                              
## [19] "Psychologists have speculated for years that the proper parenting method involves both active discussion and steady rules."                                                                                                                                                                                                   
## [20] "But rules must serve a distinct purpose, beyond merely establishing dominance or perpetuating the fallacy that rules, by their own virtue, are the end-all source of compliance."                                                                                                                                             
## [21] "Allow rules to be challenged, and even changed on occasion."                                                                                                                                                                                                                                                                  
## [22] "Let the wealth of perspectives a teacher has access to help establish the right course of action, not tradition or assumed patronage."                                                                                                                                                                                        
## [23] "Education should be defined by the fluidity of the human experience, not built to oppose it."                                                                                                                                                                                                                                 
## [24] "Supreme authority without equal exchange is as unnatural as it is futile, and both educators and the educated would benefit from avoiding it."                                                                                                                                                                                
## [25] "Instead, we should yearn to construct a bridge between student and teacher, create closer, more equal power structures to create wholehearted inspiration and higher rates of success.\""
str(ns502)
##  chr [1:25] "Considering the heightened role maintained by many in education, it's strangely rare to fin many willing to que"| __truncated__ ...
tag_pos(ns502)   # POSタグ付け
## 1.  Considering/VBG the/DT heightened/VBN role/NN ...
## 2.  Of/IN course/NN ,/, many/JJ aware/JJ of/IN the/DT ...
## 3.  It/PRP may/MD seem/VB entirely/RB silly/JJ ,/, even/RB ...
## 4.  However/RB ,/, with/IN growing/VBG competition/NN in/IN ...
## 5.  For/IN years/NNS ,/, American/JJ schools/NNS have/VBP ...
## .
## .
## .
## 21. Allow/NN rules/NNS to/TO be/VB challenged/VBN ,/, ...
## 22. Let/VB the/DT wealth/NN of/IN perspectives/NNS a/DT ...
## 23. Education/NNP should/MD be/VB defined/VBN by/IN the/DT ...
## 24. Supreme/NNP authority/NN without/IN equal/JJ ...
## 25. Instead/RB ,/, we/PRP should/MD yearn/VB to/TO ...
ns502.pos <- tag_pos(ns502)  # タグ付けした結果の保存
                              # 中身は、名前付きのベクトル
                              # ベクトルの中身が単語で、品詞がその要素の「名前」(names属性)というデータ構造

# ns502.pos %>% c()             # 名前と要素を分けてデータ構造を表示
c(ns502.pos)
## [[1]]
##           VBG            DT           VBN            NN           VBN 
## "Considering"         "the"  "heightened"        "role"  "maintained" 
##            IN            JJ            IN            NN             , 
##          "by"        "many"          "in"   "education"           "," 
##           PRP           VBZ            RB            JJ            TO 
##          "it"          "'s"   "strangely"        "rare"          "to" 
##           VBG            JJ            JJ            TO            VB 
##         "fin"        "many"     "willing"          "to"    "question" 
##            DT            NN            NN             . 
##        "this"      "status"         "quo"           "." 
## 
## [[2]]
##             IN             NN              ,             JJ             JJ 
##           "Of"       "course"            ","         "many"        "aware" 
##             IN             DT             JJ             NN             IN 
##           "of"          "the"      "dynamic"     "contrast"      "between" 
##             NN             CC             NN            VBP             RB 
##      "student"          "and"      "teacher"          "are"    "perfectly" 
##             JJ             TO             VB             CC             RB 
##      "willing"           "to"   "perpetuate"          "and"         "even" 
##             VB             DT             NN              . 
##   "strengthen"         "this" "relationship"            "." 
## 
## [[3]]
##        PRP         MD         VB         RB         JJ          ,         RB 
##       "It"      "may"     "seem" "entirely"    "silly"        ","     "even" 
##          ,         TO         VB         IN         NN        VBZ         TO 
##        ","       "to" "consider"     "that" "anything"    "needs"       "to" 
##         VB        VBN          . 
##       "be"  "changed"        "." 
## 
## [[4]]
##                RB                 ,                IN               VBG 
##         "However"               ","            "with"         "growing" 
##                NN                IN               NNS                CC 
##     "competition"              "in"      "workplaces"             "and" 
##                IN               JJR               NNS               VBG 
##            "with"           "newer"            "jobs"           "being" 
##               VBN                IN                DT                JJ 
##       "developed"              "on"               "a"         "regular" 
##                NN                 ,               PRP                MD 
##           "basis"               ","              "it"             "may" 
##                VB                JJ                TO                VB 
##              "be"       "necessary"              "to"       "reexamine" 
##                DT                JJ                NN                IN 
##            "this" "two-dimensional"       "hierarchy"              "in" 
##                NN                TO                RB                VB 
##           "order"              "to"          "better"         "prepare" 
##               NNS                IN                DT               VBG 
##        "students"             "for"             "the"        "changing" 
##                NN                 . 
##           "world"               "." 
## 
## [[5]]
##            IN           NNS             ,            JJ           NNS 
##         "For"       "years"           ","    "American"     "schools" 
##           VBP           VBN            DT            JJ            NN 
##        "have"  "maintained"           "a"      "strict"   "adherence" 
##            TO            DT            JJ             ,            JJ 
##          "to"          "an"   "invisible"           ","     "ghostly" 
##            NN             ,            CD           WDT           VBZ 
##        "code"           ","         "one"        "that"  "encourages" 
##            NN            CC            NN            IN            DT 
##     "respect"         "and"       "honor"          "in"           "a" 
##            NN            JJ            IN            DT            DT 
##      "manner" "reminiscent"          "of"        "both"         "the" 
##            NN            NN           VBD            IN           NNS 
##       "power"   "structure"       "found"          "in"   "factories" 
##            CC            DT            JJ             . 
##         "and"         "the"    "military"           "." 
## 
## [[6]]
##              IN              NN               ,              JJ             NNS 
##            "Of"        "course"             ","      "American"       "schools" 
##             VBP              RB              VB              DT              NN 
##            "do"           "n't"          "echo"          "this"      "tendency" 
##              RB              RB              RB              IN              DT 
##        "nearly"            "as"     "intensely"            "as"         "those" 
##             VBN              IN             NNP               ,              CC 
##         "found"            "in"         "Japan"             ","           "but" 
##              DT              JJ              IN              JJ              NN 
##           "the"    "elementary"       "through"          "high"        "school" 
##              NN             VBZ              CD             VBN              IN 
##    "experience"            "is"           "one"       "defined"            "by" 
##              DT              JJ              NN               . 
##            "an" "old-fashioned"   "methodology"             "." 
## 
## [[7]]
##            NNS            VBP            VBN             IN           PRP$ 
##     "Teachers"          "are"       "called"           "by"        "their" 
##             JJ             NN              ,             NN            VBZ 
##         "last"         "name"            "," "friendliness"           "is" 
##            VBN              ,             CC             NN              , 
##  "discouraged"            ","          "and"      "contact"            "," 
##             IN             DT             JJ              ,            VBZ 
##        "above"          "all"         "else"            ","           "is" 
##             RB            VBN              . 
##       "highly"       "feared"            "." 
## 
## [[8]]
##                  CC                  RB                   ,                  DT 
##               "And"               "yet"                 ","               "all" 
##                  IN                  DT                 NNS                  IN 
##                "of"              "this"           "changes"              "once" 
##                NNPS                 VBP                 NNS                   , 
##         "Americans"             "enter"      "universities"                 "," 
##                 WRB                  DT                  JJ                 NNS 
##             "where"               "the" "professor-student"             "roles" 
##                  RB                  VB                   ,                  VB 
##             "often"         "evaporate"                 ","              "save" 
##                  IN                  DT                  NN                  IN 
##               "for"               "the"          "minority"                "of" 
##                 RBR                  JJ                 NNS                   . 
##              "more"      "conservative"     "circumstances"                 "." 
## 
## [[9]]
##            JJ           NNS           VBP            JJ            TO 
##        "Many"  "professors"         "are"     "willing"          "to" 
##            VB            IN          PRP$           NNS           VBP 
## "acknowledge"        "that"       "their"    "students"        "have" 
##            RB            IN           VBN            DT            NN 
##        "long"       "since"      "passed"         "the"        "line" 
##            IN            NN            CC           VBP            JJ 
##        "into"   "adulthood"         "and"         "are"     "willing" 
##            TO            VB          PRP$            JJ            NN 
##          "to"       "share"       "their"      "normal"       "array" 
##            IN            JJ           NNS            IN           PRP 
##          "of"      "social"  "tendencies"        "with"        "them" 
##             . 
##           "." 
## 
## [[10]]
##             PRP             VBZ              RB              JJ              IN 
##            "It"            "'s"           "not"      "uncommon"           "for" 
##             NNS              TO              VB             NNS              IN 
##    "professors"            "to"        "invite"      "students"           "out" 
##              IN             NNS              TO              VB              NN 
##           "for"        "drinks"            "to"       "discuss"        "course" 
##              NN               ,              CC              RB              TO 
##      "material"             ","            "or"          "even"            "to" 
##              VB              IN              RB             VBN              JJ 
##        "engage"            "in"        "openly"      "accepted"      "romantic" 
##             NNS               . 
## "relationships"             "." 
## 
## [[11]]
##            TO            JJ           NNS           VBG            IN 
##          "To"        "many"  "foreigners"    "studying"          "in" 
##           NNP             ,            DT            MD            VB 
##     "America"           ","        "this"         "may"        "seem" 
##            RB            JJ            CC            RB            JJ 
##      "wildly" "anarchistic"         "and"      "highly"  "vulnerable" 
##            TO            NN             . 
##          "to"       "abuse"           "." 
## 
## [[12]]
##                 WRB                 PRP                 VBP                 NNS 
##          "Whenever"                 "I"              "tell"           "stories" 
##                  IN                  JJ                 NNS                  TO 
##                "of" "professor-student"     "relationships"                "to" 
##                  JJ                 NNS                   ,                  RB 
##            "French"          "students"                 ","        "especially" 
##                   ,                PRP$                  JJ                  NN 
##                 ","             "their"             "first"          "reaction" 
##                 VBZ                  TO                  VB                  IN 
##                "is"                "to"            "assume"              "that" 
##                  DT                 VBZ                  JJ                 NNS 
##              "this"             "means"              "many"        "professors" 
##                  MD                  VB                  DT                  JJ 
##              "must"             "abuse"              "this"              "open" 
##                  NN                  TO                  VB                  JJ 
##          "attitude"                "to"              "gain"       "\\\"special" 
##                 NNS                  RB                  ''                  IN 
##            "favors"                "\\"                "\""                "in" 
##                  NN                  IN                  NN                   . 
##            "return"               "for"        "favoritism"                 "." 
## 
## [[13]]
##             IN            PRP             MD             RB              , 
##        "While"            "I"           "ca"          "n't"            "," 
##             IN             NN              ,             NN             IN 
##           "of"       "course"            ","        "claim"         "that" 
##             DT            NNS             IN             DT            VBG 
##          "the"      "chances"           "of"         "this"    "occurring" 
##            VBP            VBN             IN             DT             JJ 
##          "are"       "nested"           "at"            "a"         "safe" 
##             CD             NN              ,            PRP             MD 
##         "zero"      "percent"            ","            "I"          "can" 
##             VB             IN             DT             NN            VBZ 
##          "say"         "that"         "this"     "attitude"        "stems" 
##            RBR             IN            NNS            POS             NN 
##         "more"         "from"   "professors"            "'"  "willingness" 
##             TO             VB           PRP$            NNS             IN 
##           "to"          "see"        "their"     "students"           "as" 
##             JJ            NNS              . 
## "intellectual"       "equals"            "." 
## 
## [[14]]
##           RB          WRB            ,           RB            ,          VBP 
##         "So"        "why"          ","       "then"          ","        "are" 
##          PRP          VBG         PRP$          NNS           RB           JJ 
##         "we"    "leaving"        "our"   "students"         "so" "unprepared" 
##           IN           JJ           DT           NN            . 
##        "for"       "such"         "an" "atmosphere"          "?" 
## 
## [[15]]
##           RB          PRP          VBZ           IN           NN           NN 
##    "Perhaps"         "it"         "'s"    "because"      "grade"     "school" 
##          NNS          VBP           RB           RB          VBN           IN 
##   "teachers"        "are"         "so"        "far"    "removed"       "from" 
##           DT           NN           NN           IN          PRP          VBP 
##        "the"    "college" "experience"       "that"       "they"        "'ve" 
##          VBN            ,           CC           RB          VBD            , 
##  "forgotten"          ","         "or"    "perhaps"  "proceeded"          "," 
##           DT           JJ          NNS          VBD           IN           DT 
##        "the"      "loose"      "roles"      "found"         "in"        "the" 
##           NN           NN            . 
##    "college"    "setting"          "." 
## 
## [[16]]
##          VBG           IN           NN            ,          PRP           MD 
##   "Speaking"       "from" "experience"          ","          "I"        "can" 
##           RB           VB           IN          PRP          VBP           RB 
## "absolutely"        "say"       "that"          "I"         "'m"        "far" 
##          JJR           JJ           TO           VB           IN           NN 
##       "more"      "eager"         "to"     "engage"       "with"   "material" 
##          WRB           DT           NN          VBG          PRP          VBZ 
##       "when"        "the"      "voice"  "educating"         "me"     "treats" 
##          PRP           IN           DT           NN            ,          VBG 
##         "me"       "like"          "a"   "sentient"          ","   "thinking" 
##           JJ            ,           CC           RB           RB           DT 
## "individual"          ","        "and"        "not"       "just"          "a" 
##           NN           CC           NN           JJ           TO           VB 
##      "sieve"         "or"   "receptor"      "ready"         "to"     "accept" 
##           NN           CC           NN           DT           JJ           NN 
##      "input"        "but"      "offer"         "no"     "active"   "response" 
##            . 
##          "." 
## 
## [[17]]
##           NNS           VBP            RB            RB           NNS 
##    "Students"         "are"         "not"      "merely"      "plants" 
##            TO            VB           VBN            CC           NNS 
##          "to"          "be"       "grown"         "but"      "people" 
##            TO            VB           VBN            CC            TO 
##          "to"          "be"  "challenged"         "and"          "to" 
##            VB             ,            CC            DT            JJ 
##   "challenge"           ","         "and"         "the"       "first" 
##            NN            TO           VBG            DT            NN 
##        "step"          "to" "instituting"        "this"      "change" 
##            IN            DT            JJ            NN           VBZ 
##          "in"         "the" "educational" "environment"          "is" 
##            TO            VB            DT           NNS            CC 
##          "to"        "stop"         "the" "formalities"         "and" 
##           VBP           VBG           NNS            IN           WDT 
##      "create"    "teaching" "atmospheres"          "in"       "which" 
##           NNS           VBP            JJ            TO            VB 
##    "students"         "are"     "welcome"          "to"    "interact" 
##            IN            DT           NNS            IN            DT 
##        "with"         "the"    "teachers"        "from"           "a" 
##            JJ             ,           VBN            NN             . 
##      "common"           ","      "shared"   "viewpoint"           "." 
## 
## [[18]]
##          RB          DT         VBZ          RB          TO          VB 
##       "Now"      "this"        "is"       "not"        "to"       "say" 
##          IN         NNS         VBP          TO          VB          NN 
##      "that"  "teachers"      "need"        "to"   "abandon" "authority" 
##           . 
##         "." 
## 
## [[19]]
##             NNS             VBP             VBN              IN             NNS 
## "Psychologists"          "have"    "speculated"           "for"         "years" 
##              IN              DT              JJ              NN              NN 
##          "that"           "the"        "proper"     "parenting"        "method" 
##             VBZ              DT              JJ              NN              CC 
##      "involves"          "both"        "active"    "discussion"           "and" 
##              JJ             NNS               . 
##        "steady"         "rules"             "." 
## 
## [[20]]
##             CC            NNS             MD             VB             DT 
##          "But"        "rules"         "must"        "serve"            "a" 
##             JJ             NN              ,             IN             RB 
##     "distinct"      "purpose"            ","       "beyond"       "merely" 
##            VBG             NN             CC            VBG             DT 
## "establishing"    "dominance"           "or" "perpetuating"          "the" 
##             NN             IN            NNS              ,             IN 
##      "fallacy"         "that"        "rules"            ","           "by" 
##           PRP$             JJ             NN              ,            VBP 
##        "their"          "own"       "virtue"            ","          "are" 
##             DT             JJ             NN             IN             NN 
##          "the"      "end-all"       "source"           "of"   "compliance" 
##              . 
##            "." 
## 
## [[21]]
##           NN          NNS           TO           VB          VBN            , 
##      "Allow"      "rules"         "to"         "be" "challenged"          "," 
##           CC           RB          VBD           IN           NN            . 
##        "and"       "even"    "changed"         "on"   "occasion"          "." 
## 
## [[22]]
##             VB             DT             NN             IN            NNS 
##          "Let"          "the"       "wealth"           "of" "perspectives" 
##             DT             NN            VBZ             NN             TO 
##            "a"      "teacher"          "has"       "access"           "to" 
##             VB             VB             DT             JJ             NN 
##         "help"    "establish"          "the"        "right"       "course" 
##             IN             NN              ,             RB             NN 
##           "of"       "action"            ","          "not"    "tradition" 
##             CC            VBD             NN              . 
##           "or"      "assumed"    "patronage"            "." 
## 
## [[23]]
##          NNP           MD           VB          VBN           IN           DT 
##  "Education"     "should"         "be"    "defined"         "by"        "the" 
##           NN           IN           DT           JJ           NN            , 
##   "fluidity"         "of"        "the"      "human" "experience"          "," 
##           RB          VBN           TO           VB          PRP            . 
##        "not"      "built"         "to"     "oppose"         "it"          "." 
## 
## [[24]]
##         NNP          NN          IN          JJ          NN         VBZ 
##   "Supreme" "authority"   "without"     "equal"  "exchange"        "is" 
##          RB          JJ          IN         PRP         VBZ          JJ 
##        "as" "unnatural"        "as"        "it"        "is"    "futile" 
##           ,          CC          DT         NNS          CC          DT 
##         ","       "and"      "both" "educators"       "and"       "the" 
##         VBN          MD          VB          IN         VBG         PRP 
##  "educated"     "would"   "benefit"      "from"  "avoiding"        "it" 
##           . 
##         "." 
## 
## [[25]]
##             RB              ,            PRP             MD             VB 
##      "Instead"            ","           "we"       "should"        "yearn" 
##             TO             VB             DT             NN             IN 
##           "to"    "construct"            "a"       "bridge"      "between" 
##             NN             CC             NN              ,             VB 
##      "student"          "and"      "teacher"            ","       "create" 
##            JJR              ,            RBR             JJ             NN 
##       "closer"            ","         "more"        "equal"        "power" 
##            NNS             TO             VB             JJ             NN 
##   "structures"           "to"       "create" "wholehearted"  "inspiration" 
##             CC            JJR            NNS             IN             NN 
##          "and"       "higher"        "rates"           "of"      "success" 
##              .             '' 
##            "."           "\""
str(ns502.pos)
## List of 25
##  $ : Named chr [1:24] "Considering" "the" "heightened" "role" ...
##   ..- attr(*, "names")= chr [1:24] "VBG" "DT" "VBN" "NN" ...
##  $ : Named chr [1:24] "Of" "course" "," "many" ...
##   ..- attr(*, "names")= chr [1:24] "IN" "NN" "," "JJ" ...
##  $ : Named chr [1:17] "It" "may" "seem" "entirely" ...
##   ..- attr(*, "names")= chr [1:17] "PRP" "MD" "VB" "RB" ...
##  $ : Named chr [1:38] "However" "," "with" "growing" ...
##   ..- attr(*, "names")= chr [1:38] "RB" "," "IN" "VBG" ...
##  $ : Named chr [1:39] "For" "years" "," "American" ...
##   ..- attr(*, "names")= chr [1:39] "IN" "NNS" "," "JJ" ...
##  $ : Named chr [1:34] "Of" "course" "," "American" ...
##   ..- attr(*, "names")= chr [1:34] "IN" "NN" "," "JJ" ...
##  $ : Named chr [1:23] "Teachers" "are" "called" "by" ...
##   ..- attr(*, "names")= chr [1:23] "NNS" "VBP" "VBN" "IN" ...
##  $ : Named chr [1:28] "And" "yet" "," "all" ...
##   ..- attr(*, "names")= chr [1:28] "CC" "RB" "," "DT" ...
##  $ : Named chr [1:31] "Many" "professors" "are" "willing" ...
##   ..- attr(*, "names")= chr [1:31] "JJ" "NNS" "VBP" "JJ" ...
##  $ : Named chr [1:27] "It" "'s" "not" "uncommon" ...
##   ..- attr(*, "names")= chr [1:27] "PRP" "VBZ" "RB" "JJ" ...
##  $ : Named chr [1:18] "To" "many" "foreigners" "studying" ...
##   ..- attr(*, "names")= chr [1:18] "TO" "JJ" "NNS" "VBG" ...
##  $ : Named chr [1:40] "Whenever" "I" "tell" "stories" ...
##   ..- attr(*, "names")= chr [1:40] "WRB" "PRP" "VBP" "NNS" ...
##  $ : Named chr [1:43] "While" "I" "ca" "n't" ...
##   ..- attr(*, "names")= chr [1:43] "IN" "PRP" "MD" "RB" ...
##  $ : Named chr [1:17] "So" "why" "," "then" ...
##   ..- attr(*, "names")= chr [1:17] "RB" "WRB" "," "RB" ...
##  $ : Named chr [1:33] "Perhaps" "it" "'s" "because" ...
##   ..- attr(*, "names")= chr [1:33] "RB" "PRP" "VBZ" "IN" ...
##  $ : Named chr [1:49] "Speaking" "from" "experience" "," ...
##   ..- attr(*, "names")= chr [1:49] "VBG" "IN" "NN" "," ...
##  $ : Named chr [1:55] "Students" "are" "not" "merely" ...
##   ..- attr(*, "names")= chr [1:55] "NNS" "VBP" "RB" "RB" ...
##  $ : Named chr [1:13] "Now" "this" "is" "not" ...
##   ..- attr(*, "names")= chr [1:13] "RB" "DT" "VBZ" "RB" ...
##  $ : Named chr [1:18] "Psychologists" "have" "speculated" "for" ...
##   ..- attr(*, "names")= chr [1:18] "NNS" "VBP" "VBN" "IN" ...
##  $ : Named chr [1:31] "But" "rules" "must" "serve" ...
##   ..- attr(*, "names")= chr [1:31] "CC" "NNS" "MD" "VB" ...
##  $ : Named chr [1:12] "Allow" "rules" "to" "be" ...
##   ..- attr(*, "names")= chr [1:12] "NN" "NNS" "TO" "VB" ...
##  $ : Named chr [1:24] "Let" "the" "wealth" "of" ...
##   ..- attr(*, "names")= chr [1:24] "VB" "DT" "NN" "IN" ...
##  $ : Named chr [1:18] "Education" "should" "be" "defined" ...
##   ..- attr(*, "names")= chr [1:18] "NNP" "MD" "VB" "VBN" ...
##  $ : Named chr [1:25] "Supreme" "authority" "without" "equal" ...
##   ..- attr(*, "names")= chr [1:25] "NNP" "NN" "IN" "JJ" ...
##  $ : Named chr [1:32] "Instead" "," "we" "should" ...
##   ..- attr(*, "names")= chr [1:32] "RB" "," "PRP" "MD" ...
##  - attr(*, "class")= chr [1:2] "tag_pos" "list"
#ns502.pos.df <- as.data.frame(ns502.pos)


# write.table(ns502.pos, "ns502.pos.txt", row.names=T)

品詞の頻度の棒グラフ

# ns502.pos %>% plot()
plot(ns502.pos) 

品詞の頻度一覧

# 各文ごとに(%付)
count_tags(ns502.pos)
# %なし
print(count_tags(ns502.pos), pretty=F)
##     n.tokens '' , . CC CD DT IN JJ JJR MD NN NNP NNPS NNS POS PRP PRP$ RB RBR
##  1:       24  0 1 1  0  0  2  2  4   0  0  4   0    0   0   0   1    0  1   0
##  2:       24  0 1 1  2  0  2  3  4   0  0  5   0    0   0   0   0    0  2   0
##  3:       17  0 2 1  0  0  0  1  1   0  1  1   0    0   0   0   1    0  2   0
##  4:       38  0 2 1  1  0  3  6  3   1  1  5   0    0   3   0   1    0  2   0
##  5:       39  0 3 1  2  1  6  4  6   0  0  7   0    0   3   0   0    0  0   0
##  6:       34  0 2 1  1  1  4  5  4   0  0  5   1    0   1   0   0    0  4   0
##  7:       23  0 4 1  1  0  1  2  2   0  0  3   0    0   1   0   0    1  1   0
##  8:       28  0 3 1  1  0  4  4  2   0  0  1   0    1   4   0   0    0  2   1
##  9:       31  0 0 1  1  0  1  5  5   0  0  3   0    0   3   0   1    2  1   0
## 10:       27  0 1 1  1  0  0  4  2   0  0  2   0    0   4   0   1    0  3   0
## 11:       18  0 1 1  1  0  1  1  3   0  1  1   1    0   1   0   0    0  2   0
## 12:       40  1 2 1  0  0  2  4  6   0  1  4   0    0   5   0   1    1  2   0
## 13:       43  0 3 1  0  1  4  8  2   0  2  5   0    0   4   1   2    1  1   1
## 14:       17  0 2 1  0  0  1  1  2   0  0  1   0    0   1   0   1    1  3   0
## 15:       33  0 2 1  1  0  3  4  1   0  0  6   0    0   2   0   2    0  4   0
## 16:       49  0 3 1  3  0  4  4  4   1  1  9   0    0   0   0   4    0  4   0
## 17:       55  0 2 1  4  0  6  4  4   0  0  4   0    0   7   0   0    0  2   0
## 18:       13  0 0 1  0  0  1  1  0   0  0  1   0    0   1   0   0    0  2   0
## 19:       18  0 0 1  1  0  2  2  3   0  0  3   0    0   3   0   0    0  0   0
## 20:       31  0 3 1  2  0  3  4  3   0  1  6   0    0   2   0   0    1  1   0
## 21:       12  0 1 1  1  0  0  1  0   0  0  2   0    0   1   0   0    0  1   0
## 22:       24  0 1 1  1  0  3  2  1   0  0  7   0    0   1   0   0    0  1   0
## 23:       18  0 1 1  0  0  2  2  1   0  1  2   1    0   0   0   1    0  1   0
## 24:       25  0 1 1  2  0  2  3  3   0  1  2   1    0   1   0   2    0  1   0
## 25:       32  1 3 1  2  0  1  2  2   2  1  6   0    0   2   0   1    0  1   1
##     n.tokens '' , . CC CD DT IN JJ JJR MD NN NNP NNPS NNS POS PRP PRP$ RB RBR
##     TO VB VBD VBG VBN VBP VBZ WDT WRB id
##  1:  2  1   0   2   2   0   1   0   0  1
##  2:  1  2   0   0   0   1   0   0   0  2
##  3:  2  3   0   0   1   0   1   0   0  3
##  4:  2  3   0   3   1   0   0   0   0  4
##  5:  1  0   1   0   1   1   1   1   0  5
##  6:  0  1   0   0   2   1   1   0   0  6
##  7:  0  0   0   0   3   1   2   0   0  7
##  8:  0  2   0   0   0   1   0   0   1  8
##  9:  2  2   0   0   1   3   0   0   0  9
## 10:  3  3   0   0   1   0   1   0   0 10
## 11:  2  1   0   1   0   0   0   0   0 11
## 12:  3  3   0   0   0   1   2   0   1 12
## 13:  1  2   0   1   1   1   1   0   0 13
## 14:  0  0   0   1   0   1   0   0   1 14
## 15:  0  0   2   0   2   2   1   0   0 15
## 16:  2  3   0   3   0   1   1   0   1 16
## 17:  6  5   0   2   3   3   1   1   0 17
## 18:  2  2   0   0   0   1   1   0   0 18
## 19:  0  0   0   0   1   1   1   0   0 19
## 20:  0  1   0   2   0   1   0   0   0 20
## 21:  1  1   1   0   1   0   0   0   0 21
## 22:  1  3   1   0   0   0   1   0   0 22
## 23:  1  2   0   0   2   0   0   0   0 23
## 24:  0  1   0   1   1   0   2   0   0 24
## 25:  2  4   0   0   0   0   0   0   0 25
##     TO VB VBD VBG VBN VBP VBZ WDT WRB id

特定の品詞の表示

select_tags(ns502.pos, c("VBG", "VBN"))
## 1.  Considering/VBG heightened/VBN maintained/VBN fin/VBG
## 2.  
## 3.  changed/VBN
## 4.  growing/VBG being/VBG developed/VBN changing/VBG
## 5.  maintained/VBN
## .
## .
## .
## 21. challenged/VBN
## 22. 
## 23. defined/VBN built/VBN
## 24. educated/VBN avoiding/VBG
## 25.

わかりやすいタグに変換

as_universal(ns502.pos)
## 1.  Considering/VERB the/DET heightened/VERB role/NOUN ...
## 2.  Of/ADP course/NOUN ,/. many/ADJ aware/ADJ of/ADP ...
## 3.  It/PRON may/VERB seem/VERB entirely/ADV silly/ADJ ,/. ...
## 4.  However/ADV ,/. with/ADP growing/VERB competition/NOUN ...
## 5.  For/ADP years/NOUN ,/. American/ADJ schools/NOUN ...
## .
## .
## .
## 21. Allow/NOUN rules/NOUN to/PRT be/VERB challenged/VERB ...
## 22. Let/VERB the/DET wealth/NOUN of/ADP perspectives/NOUN ...
## 23. Education/NOUN should/VERB be/VERB defined/VERB by/ADP ...
## 24. Supreme/NOUN authority/NOUN without/ADP equal/ADJ ...
## 25. Instead/ADV ,/. we/PRON should/VERB yearn/VERB to/PRT ...
plot(as_universal(ns502.pos))

基礎的な品詞に変換

as_basic(ns502.pos)
## 1.  Considering/verb the/article heightened/verb role/noun ...
## 2.  Of/preposition course/noun ,/. many/adjective ...
## 3.  It/pronoun may/verb seem/verb entirely/adverb ...
## 4.  However/adverb ,/. with/preposition growing/verb ...
## 5.  For/preposition years/noun ,/. American/adjective ...
## .
## .
## .
## 21. Allow/noun rules/noun to/preposition be/verb ...
## 22. Let/verb the/article wealth/noun of/preposition ...
## 23. Education/noun should/verb be/verb defined/verb ...
## 24. Supreme/noun authority/noun without/preposition ...
## 25. Instead/adverb ,/. we/pronoun should/verb yearn/verb ...
ns502.pos.basic <- as_basic(ns502.pos)

head(ns502.pos.basic)
## [[1]]
##          verb       article          verb          noun          verb 
## "Considering"         "the"  "heightened"        "role"  "maintained" 
##   preposition     adjective   preposition          noun             . 
##          "by"        "many"          "in"   "education"           "," 
##       pronoun          verb        adverb     adjective   preposition 
##          "it"          "'s"   "strangely"        "rare"          "to" 
##          verb     adjective     adjective   preposition          verb 
##         "fin"        "many"     "willing"          "to"    "question" 
##     adjective          noun          noun             . 
##        "this"      "status"         "quo"           "." 
## 
## [[2]]
##    preposition           noun              .      adjective      adjective 
##           "Of"       "course"            ","         "many"        "aware" 
##    preposition        article      adjective           noun    preposition 
##           "of"          "the"      "dynamic"     "contrast"      "between" 
##           noun    conjunction           noun           verb         adverb 
##      "student"          "and"      "teacher"          "are"    "perfectly" 
##      adjective    preposition           verb    conjunction         adverb 
##      "willing"           "to"   "perpetuate"          "and"         "even" 
##           verb      adjective           noun              . 
##   "strengthen"         "this" "relationship"            "." 
## 
## [[3]]
##     pronoun        verb        verb      adverb   adjective           . 
##        "It"       "may"      "seem"  "entirely"     "silly"         "," 
##      adverb           . preposition        verb preposition        noun 
##      "even"         ","        "to"  "consider"      "that"  "anything" 
##        verb preposition        verb        verb           . 
##     "needs"        "to"        "be"   "changed"         "." 
## 
## [[4]]
##            adverb                 .       preposition              verb 
##         "However"               ","            "with"         "growing" 
##              noun       preposition              noun       conjunction 
##     "competition"              "in"      "workplaces"             "and" 
##       preposition         adjective              noun              verb 
##            "with"           "newer"            "jobs"           "being" 
##              verb       preposition           article         adjective 
##       "developed"              "on"               "a"         "regular" 
##              noun                 .           pronoun              verb 
##           "basis"               ","              "it"             "may" 
##              verb         adjective       preposition              verb 
##              "be"       "necessary"              "to"       "reexamine" 
##         adjective         adjective              noun       preposition 
##            "this" "two-dimensional"       "hierarchy"              "in" 
##              noun       preposition            adverb              verb 
##           "order"              "to"          "better"         "prepare" 
##              noun       preposition           article              verb 
##        "students"             "for"             "the"        "changing" 
##              noun                 . 
##           "world"               "." 
## 
## [[5]]
##   preposition          noun             .     adjective          noun 
##         "For"       "years"           ","    "American"     "schools" 
##          verb          verb       article     adjective          noun 
##        "have"  "maintained"           "a"      "strict"   "adherence" 
##   preposition       article     adjective             .     adjective 
##          "to"          "an"   "invisible"           ","     "ghostly" 
##          noun             .     adjective       pronoun          verb 
##        "code"           ","         "one"        "that"  "encourages" 
##          noun   conjunction          noun   preposition       article 
##     "respect"         "and"       "honor"          "in"           "a" 
##          noun     adjective   preposition     adjective       article 
##      "manner" "reminiscent"          "of"        "both"         "the" 
##          noun          noun          verb   preposition          noun 
##       "power"   "structure"       "found"          "in"   "factories" 
##   conjunction       article     adjective             . 
##         "and"         "the"    "military"           "." 
## 
## [[6]]
##     preposition            noun               .       adjective            noun 
##            "Of"        "course"             ","      "American"       "schools" 
##            verb          adverb            verb       adjective            noun 
##            "do"           "n't"          "echo"          "this"      "tendency" 
##          adverb          adverb          adverb     preposition       adjective 
##        "nearly"            "as"     "intensely"            "as"         "those" 
##            verb     preposition            noun               .     conjunction 
##         "found"            "in"         "Japan"             ","           "but" 
##         article       adjective     preposition       adjective            noun 
##           "the"    "elementary"       "through"          "high"        "school" 
##            noun            verb       adjective            verb     preposition 
##    "experience"            "is"           "one"       "defined"            "by" 
##         article       adjective            noun               . 
##            "an" "old-fashioned"   "methodology"             "."
plot(ns502.pos.basic)

品詞付きのテキストにする

as_word_tag(ns502.pos)
##  [1] "Considering/VBG the/DT heightened/VBN role/NN maintained/VBN by/IN many/JJ in/IN education/NN ,/, it/PRP 's/VBZ strangely/RB rare/JJ to/TO fin/VBG many/JJ willing/JJ to/TO question/VB this/DT status/NN quo/NN ./."                                                                                                                                                                                                                                                                                               
##  [2] "Of/IN course/NN ,/, many/JJ aware/JJ of/IN the/DT dynamic/JJ contrast/NN between/IN student/NN and/CC teacher/NN are/VBP perfectly/RB willing/JJ to/TO perpetuate/VB and/CC even/RB strengthen/VB this/DT relationship/NN ./."                                                                                                                                                                                                                                                                                      
##  [3] "It/PRP may/MD seem/VB entirely/RB silly/JJ ,/, even/RB ,/, to/TO consider/VB that/IN anything/NN needs/VBZ to/TO be/VB changed/VBN ./."                                                                                                                                                                                                                                                                                                                                                                             
##  [4] "However/RB ,/, with/IN growing/VBG competition/NN in/IN workplaces/NNS and/CC with/IN newer/JJR jobs/NNS being/VBG developed/VBN on/IN a/DT regular/JJ basis/NN ,/, it/PRP may/MD be/VB necessary/JJ to/TO reexamine/VB this/DT two-dimensional/JJ hierarchy/NN in/IN order/NN to/TO better/RB prepare/VB students/NNS for/IN the/DT changing/VBG world/NN ./."                                                                                                                                                     
##  [5] "For/IN years/NNS ,/, American/JJ schools/NNS have/VBP maintained/VBN a/DT strict/JJ adherence/NN to/TO an/DT invisible/JJ ,/, ghostly/JJ code/NN ,/, one/CD that/WDT encourages/VBZ respect/NN and/CC honor/NN in/IN a/DT manner/NN reminiscent/JJ of/IN both/DT the/DT power/NN structure/NN found/VBD in/IN factories/NNS and/CC the/DT military/JJ ./."                                                                                                                                                          
##  [6] "Of/IN course/NN ,/, American/JJ schools/NNS do/VBP n't/RB echo/VB this/DT tendency/NN nearly/RB as/RB intensely/RB as/IN those/DT found/VBN in/IN Japan/NNP ,/, but/CC the/DT elementary/JJ through/IN high/JJ school/NN experience/NN is/VBZ one/CD defined/VBN by/IN an/DT old-fashioned/JJ methodology/NN ./."                                                                                                                                                                                                   
##  [7] "Teachers/NNS are/VBP called/VBN by/IN their/PRP$ last/JJ name/NN ,/, friendliness/NN is/VBZ discouraged/VBN ,/, and/CC contact/NN ,/, above/IN all/DT else/JJ ,/, is/VBZ highly/RB feared/VBN ./."                                                                                                                                                                                                                                                                                                                  
##  [8] "And/CC yet/RB ,/, all/DT of/IN this/DT changes/NNS once/IN Americans/NNPS enter/VBP universities/NNS ,/, where/WRB the/DT professor-student/JJ roles/NNS often/RB evaporate/VB ,/, save/VB for/IN the/DT minority/NN of/IN more/RBR conservative/JJ circumstances/NNS ./."                                                                                                                                                                                                                                          
##  [9] "Many/JJ professors/NNS are/VBP willing/JJ to/TO acknowledge/VB that/IN their/PRP$ students/NNS have/VBP long/RB since/IN passed/VBN the/DT line/NN into/IN adulthood/NN and/CC are/VBP willing/JJ to/TO share/VB their/PRP$ normal/JJ array/NN of/IN social/JJ tendencies/NNS with/IN them/PRP ./."                                                                                                                                                                                                                 
## [10] "It/PRP 's/VBZ not/RB uncommon/JJ for/IN professors/NNS to/TO invite/VB students/NNS out/IN for/IN drinks/NNS to/TO discuss/VB course/NN material/NN ,/, or/CC even/RB to/TO engage/VB in/IN openly/RB accepted/VBN romantic/JJ relationships/NNS ./."                                                                                                                                                                                                                                                               
## [11] "To/TO many/JJ foreigners/NNS studying/VBG in/IN America/NNP ,/, this/DT may/MD seem/VB wildly/RB anarchistic/JJ and/CC highly/RB vulnerable/JJ to/TO abuse/NN ./."                                                                                                                                                                                                                                                                                                                                                  
## [12] "Whenever/WRB I/PRP tell/VBP stories/NNS of/IN professor-student/JJ relationships/NNS to/TO French/JJ students/NNS ,/, especially/RB ,/, their/PRP$ first/JJ reaction/NN is/VBZ to/TO assume/VB that/IN this/DT means/VBZ many/JJ professors/NNS must/MD abuse/VB this/DT open/JJ attitude/NN to/TO gain/VB \\\"special/JJ favors/NNS \\/RB \"/'' in/IN return/NN for/IN favoritism/NN ./."                                                                                                                          
## [13] "While/IN I/PRP ca/MD n't/RB ,/, of/IN course/NN ,/, claim/NN that/IN the/DT chances/NNS of/IN this/DT occurring/VBG are/VBP nested/VBN at/IN a/DT safe/JJ zero/CD percent/NN ,/, I/PRP can/MD say/VB that/IN this/DT attitude/NN stems/VBZ more/RBR from/IN professors/NNS '/POS willingness/NN to/TO see/VB their/PRP$ students/NNS as/IN intellectual/JJ equals/NNS ./."                                                                                                                                          
## [14] "So/RB why/WRB ,/, then/RB ,/, are/VBP we/PRP leaving/VBG our/PRP$ students/NNS so/RB unprepared/JJ for/IN such/JJ an/DT atmosphere/NN ?/."                                                                                                                                                                                                                                                                                                                                                                          
## [15] "Perhaps/RB it/PRP 's/VBZ because/IN grade/NN school/NN teachers/NNS are/VBP so/RB far/RB removed/VBN from/IN the/DT college/NN experience/NN that/IN they/PRP 've/VBP forgotten/VBN ,/, or/CC perhaps/RB proceeded/VBD ,/, the/DT loose/JJ roles/NNS found/VBD in/IN the/DT college/NN setting/NN ./."                                                                                                                                                                                                              
## [16] "Speaking/VBG from/IN experience/NN ,/, I/PRP can/MD absolutely/RB say/VB that/IN I/PRP 'm/VBP far/RB more/JJR eager/JJ to/TO engage/VB with/IN material/NN when/WRB the/DT voice/NN educating/VBG me/PRP treats/VBZ me/PRP like/IN a/DT sentient/NN ,/, thinking/VBG individual/JJ ,/, and/CC not/RB just/RB a/DT sieve/NN or/CC receptor/NN ready/JJ to/TO accept/VB input/NN but/CC offer/NN no/DT active/JJ response/NN ./."                                                                                     
## [17] "Students/NNS are/VBP not/RB merely/RB plants/NNS to/TO be/VB grown/VBN but/CC people/NNS to/TO be/VB challenged/VBN and/CC to/TO challenge/VB ,/, and/CC the/DT first/JJ step/NN to/TO instituting/VBG this/DT change/NN in/IN the/DT educational/JJ environment/NN is/VBZ to/TO stop/VB the/DT formalities/NNS and/CC create/VBP teaching/VBG atmospheres/NNS in/IN which/WDT students/NNS are/VBP welcome/JJ to/TO interact/VB with/IN the/DT teachers/NNS from/IN a/DT common/JJ ,/, shared/VBN viewpoint/NN ./."
## [18] "Now/RB this/DT is/VBZ not/RB to/TO say/VB that/IN teachers/NNS need/VBP to/TO abandon/VB authority/NN ./."                                                                                                                                                                                                                                                                                                                                                                                                          
## [19] "Psychologists/NNS have/VBP speculated/VBN for/IN years/NNS that/IN the/DT proper/JJ parenting/NN method/NN involves/VBZ both/DT active/JJ discussion/NN and/CC steady/JJ rules/NNS ./."                                                                                                                                                                                                                                                                                                                             
## [20] "But/CC rules/NNS must/MD serve/VB a/DT distinct/JJ purpose/NN ,/, beyond/IN merely/RB establishing/VBG dominance/NN or/CC perpetuating/VBG the/DT fallacy/NN that/IN rules/NNS ,/, by/IN their/PRP$ own/JJ virtue/NN ,/, are/VBP the/DT end-all/JJ source/NN of/IN compliance/NN ./."                                                                                                                                                                                                                               
## [21] "Allow/NN rules/NNS to/TO be/VB challenged/VBN ,/, and/CC even/RB changed/VBD on/IN occasion/NN ./."                                                                                                                                                                                                                                                                                                                                                                                                                 
## [22] "Let/VB the/DT wealth/NN of/IN perspectives/NNS a/DT teacher/NN has/VBZ access/NN to/TO help/VB establish/VB the/DT right/JJ course/NN of/IN action/NN ,/, not/RB tradition/NN or/CC assumed/VBD patronage/NN ./."                                                                                                                                                                                                                                                                                                   
## [23] "Education/NNP should/MD be/VB defined/VBN by/IN the/DT fluidity/NN of/IN the/DT human/JJ experience/NN ,/, not/RB built/VBN to/TO oppose/VB it/PRP ./."                                                                                                                                                                                                                                                                                                                                                             
## [24] "Supreme/NNP authority/NN without/IN equal/JJ exchange/NN is/VBZ as/RB unnatural/JJ as/IN it/PRP is/VBZ futile/JJ ,/, and/CC both/DT educators/NNS and/CC the/DT educated/VBN would/MD benefit/VB from/IN avoiding/VBG it/PRP ./."                                                                                                                                                                                                                                                                                   
## [25] "Instead/RB ,/, we/PRP should/MD yearn/VB to/TO construct/VB a/DT bridge/NN between/IN student/NN and/CC teacher/NN ,/, create/VB closer/JJR ,/, more/RBR equal/JJ power/NN structures/NNS to/TO create/VB wholehearted/JJ inspiration/NN and/CC higher/JJR rates/NNS of/IN success/NN ./. \"/''"

構成素ごとにまとめる

as_tuple(ns502.pos)
## [[("Considering", "VBG"), ("the", "DT"), ("heightened", "VBN"), ("role", "NN"), ("maintained", "VBN"), ("by", "IN"), ("many", "JJ"), ("in", "IN"), ("education", "NN"), (",", ","), ("it", "PRP"), ("'s", "VBZ"), ("strangely", "RB"), ("rare", "JJ"), ("to", "TO"), ("fin", "VBG"), ("many", "JJ"), ("willing", "JJ"), ("to", "TO"), ("question", "VB"), ("this", "DT"), ("status", "NN"), ("quo", "NN"), (".", ".")], [("Of", "IN"), ("course", "NN"), (",", ","), ("many", "JJ"), ("aware", "JJ"), ("of", "IN"), ("the", "DT"), ("dynamic", "JJ"), ("contrast", "NN"), ("between", "IN"), ("student", "NN"), ("and", "CC"), ("teacher", "NN"), ("are", "VBP"), ("perfectly", "RB"), ("willing", "JJ"), ("to", "TO"), ("perpetuate", "VB"), ("and", "CC"), ("even", "RB"), ("strengthen", "VB"), ("this", "DT"), ("relationship", "NN"), (".", ".")], [("It", "PRP"), ("may", "MD"), ("seem", "VB"), ("entirely", "RB"), ("silly", "JJ"), (",", ","), ("even", "RB"), (",", ","), ("to", "TO"), ("consider", "VB"), ("that", "IN"), ("anything", "NN"), ("needs", "VBZ"), ("to", "TO"), ("be", "VB"), ("changed", "VBN"), (".", ".")], [("However", "RB"), (",", ","), ("with", "IN"), ("growing", "VBG"), ("competition", "NN"), ("in", "IN"), ("workplaces", "NNS"), ("and", "CC"), ("with", "IN"), ("newer", "JJR"), ("jobs", "NNS"), ("being", "VBG"), ("developed", "VBN"), ("on", "IN"), ("a", "DT"), ("regular", "JJ"), ("basis", "NN"), (",", ","), ("it", "PRP"), ("may", "MD"), ("be", "VB"), ("necessary", "JJ"), ("to", "TO"), ("reexamine", "...

品詞だけ取り出す

sapply(ns502.pos, names)
## [[1]]
##  [1] "VBG" "DT"  "VBN" "NN"  "VBN" "IN"  "JJ"  "IN"  "NN"  ","   "PRP" "VBZ"
## [13] "RB"  "JJ"  "TO"  "VBG" "JJ"  "JJ"  "TO"  "VB"  "DT"  "NN"  "NN"  "."  
## 
## [[2]]
##  [1] "IN"  "NN"  ","   "JJ"  "JJ"  "IN"  "DT"  "JJ"  "NN"  "IN"  "NN"  "CC" 
## [13] "NN"  "VBP" "RB"  "JJ"  "TO"  "VB"  "CC"  "RB"  "VB"  "DT"  "NN"  "."  
## 
## [[3]]
##  [1] "PRP" "MD"  "VB"  "RB"  "JJ"  ","   "RB"  ","   "TO"  "VB"  "IN"  "NN" 
## [13] "VBZ" "TO"  "VB"  "VBN" "."  
## 
## [[4]]
##  [1] "RB"  ","   "IN"  "VBG" "NN"  "IN"  "NNS" "CC"  "IN"  "JJR" "NNS" "VBG"
## [13] "VBN" "IN"  "DT"  "JJ"  "NN"  ","   "PRP" "MD"  "VB"  "JJ"  "TO"  "VB" 
## [25] "DT"  "JJ"  "NN"  "IN"  "NN"  "TO"  "RB"  "VB"  "NNS" "IN"  "DT"  "VBG"
## [37] "NN"  "."  
## 
## [[5]]
##  [1] "IN"  "NNS" ","   "JJ"  "NNS" "VBP" "VBN" "DT"  "JJ"  "NN"  "TO"  "DT" 
## [13] "JJ"  ","   "JJ"  "NN"  ","   "CD"  "WDT" "VBZ" "NN"  "CC"  "NN"  "IN" 
## [25] "DT"  "NN"  "JJ"  "IN"  "DT"  "DT"  "NN"  "NN"  "VBD" "IN"  "NNS" "CC" 
## [37] "DT"  "JJ"  "."  
## 
## [[6]]
##  [1] "IN"  "NN"  ","   "JJ"  "NNS" "VBP" "RB"  "VB"  "DT"  "NN"  "RB"  "RB" 
## [13] "RB"  "IN"  "DT"  "VBN" "IN"  "NNP" ","   "CC"  "DT"  "JJ"  "IN"  "JJ" 
## [25] "NN"  "NN"  "VBZ" "CD"  "VBN" "IN"  "DT"  "JJ"  "NN"  "."  
## 
## [[7]]
##  [1] "NNS"  "VBP"  "VBN"  "IN"   "PRP$" "JJ"   "NN"   ","    "NN"   "VBZ" 
## [11] "VBN"  ","    "CC"   "NN"   ","    "IN"   "DT"   "JJ"   ","    "VBZ" 
## [21] "RB"   "VBN"  "."   
## 
## [[8]]
##  [1] "CC"   "RB"   ","    "DT"   "IN"   "DT"   "NNS"  "IN"   "NNPS" "VBP" 
## [11] "NNS"  ","    "WRB"  "DT"   "JJ"   "NNS"  "RB"   "VB"   ","    "VB"  
## [21] "IN"   "DT"   "NN"   "IN"   "RBR"  "JJ"   "NNS"  "."   
## 
## [[9]]
##  [1] "JJ"   "NNS"  "VBP"  "JJ"   "TO"   "VB"   "IN"   "PRP$" "NNS"  "VBP" 
## [11] "RB"   "IN"   "VBN"  "DT"   "NN"   "IN"   "NN"   "CC"   "VBP"  "JJ"  
## [21] "TO"   "VB"   "PRP$" "JJ"   "NN"   "IN"   "JJ"   "NNS"  "IN"   "PRP" 
## [31] "."   
## 
## [[10]]
##  [1] "PRP" "VBZ" "RB"  "JJ"  "IN"  "NNS" "TO"  "VB"  "NNS" "IN"  "IN"  "NNS"
## [13] "TO"  "VB"  "NN"  "NN"  ","   "CC"  "RB"  "TO"  "VB"  "IN"  "RB"  "VBN"
## [25] "JJ"  "NNS" "."  
## 
## [[11]]
##  [1] "TO"  "JJ"  "NNS" "VBG" "IN"  "NNP" ","   "DT"  "MD"  "VB"  "RB"  "JJ" 
## [13] "CC"  "RB"  "JJ"  "TO"  "NN"  "."  
## 
## [[12]]
##  [1] "WRB"  "PRP"  "VBP"  "NNS"  "IN"   "JJ"   "NNS"  "TO"   "JJ"   "NNS" 
## [11] ","    "RB"   ","    "PRP$" "JJ"   "NN"   "VBZ"  "TO"   "VB"   "IN"  
## [21] "DT"   "VBZ"  "JJ"   "NNS"  "MD"   "VB"   "DT"   "JJ"   "NN"   "TO"  
## [31] "VB"   "JJ"   "NNS"  "RB"   "''"   "IN"   "NN"   "IN"   "NN"   "."   
## 
## [[13]]
##  [1] "IN"   "PRP"  "MD"   "RB"   ","    "IN"   "NN"   ","    "NN"   "IN"  
## [11] "DT"   "NNS"  "IN"   "DT"   "VBG"  "VBP"  "VBN"  "IN"   "DT"   "JJ"  
## [21] "CD"   "NN"   ","    "PRP"  "MD"   "VB"   "IN"   "DT"   "NN"   "VBZ" 
## [31] "RBR"  "IN"   "NNS"  "POS"  "NN"   "TO"   "VB"   "PRP$" "NNS"  "IN"  
## [41] "JJ"   "NNS"  "."   
## 
## [[14]]
##  [1] "RB"   "WRB"  ","    "RB"   ","    "VBP"  "PRP"  "VBG"  "PRP$" "NNS" 
## [11] "RB"   "JJ"   "IN"   "JJ"   "DT"   "NN"   "."   
## 
## [[15]]
##  [1] "RB"  "PRP" "VBZ" "IN"  "NN"  "NN"  "NNS" "VBP" "RB"  "RB"  "VBN" "IN" 
## [13] "DT"  "NN"  "NN"  "IN"  "PRP" "VBP" "VBN" ","   "CC"  "RB"  "VBD" ","  
## [25] "DT"  "JJ"  "NNS" "VBD" "IN"  "DT"  "NN"  "NN"  "."  
## 
## [[16]]
##  [1] "VBG" "IN"  "NN"  ","   "PRP" "MD"  "RB"  "VB"  "IN"  "PRP" "VBP" "RB" 
## [13] "JJR" "JJ"  "TO"  "VB"  "IN"  "NN"  "WRB" "DT"  "NN"  "VBG" "PRP" "VBZ"
## [25] "PRP" "IN"  "DT"  "NN"  ","   "VBG" "JJ"  ","   "CC"  "RB"  "RB"  "DT" 
## [37] "NN"  "CC"  "NN"  "JJ"  "TO"  "VB"  "NN"  "CC"  "NN"  "DT"  "JJ"  "NN" 
## [49] "."  
## 
## [[17]]
##  [1] "NNS" "VBP" "RB"  "RB"  "NNS" "TO"  "VB"  "VBN" "CC"  "NNS" "TO"  "VB" 
## [13] "VBN" "CC"  "TO"  "VB"  ","   "CC"  "DT"  "JJ"  "NN"  "TO"  "VBG" "DT" 
## [25] "NN"  "IN"  "DT"  "JJ"  "NN"  "VBZ" "TO"  "VB"  "DT"  "NNS" "CC"  "VBP"
## [37] "VBG" "NNS" "IN"  "WDT" "NNS" "VBP" "JJ"  "TO"  "VB"  "IN"  "DT"  "NNS"
## [49] "IN"  "DT"  "JJ"  ","   "VBN" "NN"  "."  
## 
## [[18]]
##  [1] "RB"  "DT"  "VBZ" "RB"  "TO"  "VB"  "IN"  "NNS" "VBP" "TO"  "VB"  "NN" 
## [13] "."  
## 
## [[19]]
##  [1] "NNS" "VBP" "VBN" "IN"  "NNS" "IN"  "DT"  "JJ"  "NN"  "NN"  "VBZ" "DT" 
## [13] "JJ"  "NN"  "CC"  "JJ"  "NNS" "."  
## 
## [[20]]
##  [1] "CC"   "NNS"  "MD"   "VB"   "DT"   "JJ"   "NN"   ","    "IN"   "RB"  
## [11] "VBG"  "NN"   "CC"   "VBG"  "DT"   "NN"   "IN"   "NNS"  ","    "IN"  
## [21] "PRP$" "JJ"   "NN"   ","    "VBP"  "DT"   "JJ"   "NN"   "IN"   "NN"  
## [31] "."   
## 
## [[21]]
##  [1] "NN"  "NNS" "TO"  "VB"  "VBN" ","   "CC"  "RB"  "VBD" "IN"  "NN"  "."  
## 
## [[22]]
##  [1] "VB"  "DT"  "NN"  "IN"  "NNS" "DT"  "NN"  "VBZ" "NN"  "TO"  "VB"  "VB" 
## [13] "DT"  "JJ"  "NN"  "IN"  "NN"  ","   "RB"  "NN"  "CC"  "VBD" "NN"  "."  
## 
## [[23]]
##  [1] "NNP" "MD"  "VB"  "VBN" "IN"  "DT"  "NN"  "IN"  "DT"  "JJ"  "NN"  ","  
## [13] "RB"  "VBN" "TO"  "VB"  "PRP" "."  
## 
## [[24]]
##  [1] "NNP" "NN"  "IN"  "JJ"  "NN"  "VBZ" "RB"  "JJ"  "IN"  "PRP" "VBZ" "JJ" 
## [13] ","   "CC"  "DT"  "NNS" "CC"  "DT"  "VBN" "MD"  "VB"  "IN"  "VBG" "PRP"
## [25] "."  
## 
## [[25]]
##  [1] "RB"  ","   "PRP" "MD"  "VB"  "TO"  "VB"  "DT"  "NN"  "IN"  "NN"  "CC" 
## [13] "NN"  ","   "VB"  "JJR" ","   "RBR" "JJ"  "NN"  "NNS" "TO"  "VB"  "JJ" 
## [25] "NN"  "CC"  "JJR" "NNS" "IN"  "NN"  "."   "''"
# もしくは
unname(sapply(ns502.pos, attributes))
## [[1]]
##  [1] "VBG" "DT"  "VBN" "NN"  "VBN" "IN"  "JJ"  "IN"  "NN"  ","   "PRP" "VBZ"
## [13] "RB"  "JJ"  "TO"  "VBG" "JJ"  "JJ"  "TO"  "VB"  "DT"  "NN"  "NN"  "."  
## 
## [[2]]
##  [1] "IN"  "NN"  ","   "JJ"  "JJ"  "IN"  "DT"  "JJ"  "NN"  "IN"  "NN"  "CC" 
## [13] "NN"  "VBP" "RB"  "JJ"  "TO"  "VB"  "CC"  "RB"  "VB"  "DT"  "NN"  "."  
## 
## [[3]]
##  [1] "PRP" "MD"  "VB"  "RB"  "JJ"  ","   "RB"  ","   "TO"  "VB"  "IN"  "NN" 
## [13] "VBZ" "TO"  "VB"  "VBN" "."  
## 
## [[4]]
##  [1] "RB"  ","   "IN"  "VBG" "NN"  "IN"  "NNS" "CC"  "IN"  "JJR" "NNS" "VBG"
## [13] "VBN" "IN"  "DT"  "JJ"  "NN"  ","   "PRP" "MD"  "VB"  "JJ"  "TO"  "VB" 
## [25] "DT"  "JJ"  "NN"  "IN"  "NN"  "TO"  "RB"  "VB"  "NNS" "IN"  "DT"  "VBG"
## [37] "NN"  "."  
## 
## [[5]]
##  [1] "IN"  "NNS" ","   "JJ"  "NNS" "VBP" "VBN" "DT"  "JJ"  "NN"  "TO"  "DT" 
## [13] "JJ"  ","   "JJ"  "NN"  ","   "CD"  "WDT" "VBZ" "NN"  "CC"  "NN"  "IN" 
## [25] "DT"  "NN"  "JJ"  "IN"  "DT"  "DT"  "NN"  "NN"  "VBD" "IN"  "NNS" "CC" 
## [37] "DT"  "JJ"  "."  
## 
## [[6]]
##  [1] "IN"  "NN"  ","   "JJ"  "NNS" "VBP" "RB"  "VB"  "DT"  "NN"  "RB"  "RB" 
## [13] "RB"  "IN"  "DT"  "VBN" "IN"  "NNP" ","   "CC"  "DT"  "JJ"  "IN"  "JJ" 
## [25] "NN"  "NN"  "VBZ" "CD"  "VBN" "IN"  "DT"  "JJ"  "NN"  "."  
## 
## [[7]]
##  [1] "NNS"  "VBP"  "VBN"  "IN"   "PRP$" "JJ"   "NN"   ","    "NN"   "VBZ" 
## [11] "VBN"  ","    "CC"   "NN"   ","    "IN"   "DT"   "JJ"   ","    "VBZ" 
## [21] "RB"   "VBN"  "."   
## 
## [[8]]
##  [1] "CC"   "RB"   ","    "DT"   "IN"   "DT"   "NNS"  "IN"   "NNPS" "VBP" 
## [11] "NNS"  ","    "WRB"  "DT"   "JJ"   "NNS"  "RB"   "VB"   ","    "VB"  
## [21] "IN"   "DT"   "NN"   "IN"   "RBR"  "JJ"   "NNS"  "."   
## 
## [[9]]
##  [1] "JJ"   "NNS"  "VBP"  "JJ"   "TO"   "VB"   "IN"   "PRP$" "NNS"  "VBP" 
## [11] "RB"   "IN"   "VBN"  "DT"   "NN"   "IN"   "NN"   "CC"   "VBP"  "JJ"  
## [21] "TO"   "VB"   "PRP$" "JJ"   "NN"   "IN"   "JJ"   "NNS"  "IN"   "PRP" 
## [31] "."   
## 
## [[10]]
##  [1] "PRP" "VBZ" "RB"  "JJ"  "IN"  "NNS" "TO"  "VB"  "NNS" "IN"  "IN"  "NNS"
## [13] "TO"  "VB"  "NN"  "NN"  ","   "CC"  "RB"  "TO"  "VB"  "IN"  "RB"  "VBN"
## [25] "JJ"  "NNS" "."  
## 
## [[11]]
##  [1] "TO"  "JJ"  "NNS" "VBG" "IN"  "NNP" ","   "DT"  "MD"  "VB"  "RB"  "JJ" 
## [13] "CC"  "RB"  "JJ"  "TO"  "NN"  "."  
## 
## [[12]]
##  [1] "WRB"  "PRP"  "VBP"  "NNS"  "IN"   "JJ"   "NNS"  "TO"   "JJ"   "NNS" 
## [11] ","    "RB"   ","    "PRP$" "JJ"   "NN"   "VBZ"  "TO"   "VB"   "IN"  
## [21] "DT"   "VBZ"  "JJ"   "NNS"  "MD"   "VB"   "DT"   "JJ"   "NN"   "TO"  
## [31] "VB"   "JJ"   "NNS"  "RB"   "''"   "IN"   "NN"   "IN"   "NN"   "."   
## 
## [[13]]
##  [1] "IN"   "PRP"  "MD"   "RB"   ","    "IN"   "NN"   ","    "NN"   "IN"  
## [11] "DT"   "NNS"  "IN"   "DT"   "VBG"  "VBP"  "VBN"  "IN"   "DT"   "JJ"  
## [21] "CD"   "NN"   ","    "PRP"  "MD"   "VB"   "IN"   "DT"   "NN"   "VBZ" 
## [31] "RBR"  "IN"   "NNS"  "POS"  "NN"   "TO"   "VB"   "PRP$" "NNS"  "IN"  
## [41] "JJ"   "NNS"  "."   
## 
## [[14]]
##  [1] "RB"   "WRB"  ","    "RB"   ","    "VBP"  "PRP"  "VBG"  "PRP$" "NNS" 
## [11] "RB"   "JJ"   "IN"   "JJ"   "DT"   "NN"   "."   
## 
## [[15]]
##  [1] "RB"  "PRP" "VBZ" "IN"  "NN"  "NN"  "NNS" "VBP" "RB"  "RB"  "VBN" "IN" 
## [13] "DT"  "NN"  "NN"  "IN"  "PRP" "VBP" "VBN" ","   "CC"  "RB"  "VBD" ","  
## [25] "DT"  "JJ"  "NNS" "VBD" "IN"  "DT"  "NN"  "NN"  "."  
## 
## [[16]]
##  [1] "VBG" "IN"  "NN"  ","   "PRP" "MD"  "RB"  "VB"  "IN"  "PRP" "VBP" "RB" 
## [13] "JJR" "JJ"  "TO"  "VB"  "IN"  "NN"  "WRB" "DT"  "NN"  "VBG" "PRP" "VBZ"
## [25] "PRP" "IN"  "DT"  "NN"  ","   "VBG" "JJ"  ","   "CC"  "RB"  "RB"  "DT" 
## [37] "NN"  "CC"  "NN"  "JJ"  "TO"  "VB"  "NN"  "CC"  "NN"  "DT"  "JJ"  "NN" 
## [49] "."  
## 
## [[17]]
##  [1] "NNS" "VBP" "RB"  "RB"  "NNS" "TO"  "VB"  "VBN" "CC"  "NNS" "TO"  "VB" 
## [13] "VBN" "CC"  "TO"  "VB"  ","   "CC"  "DT"  "JJ"  "NN"  "TO"  "VBG" "DT" 
## [25] "NN"  "IN"  "DT"  "JJ"  "NN"  "VBZ" "TO"  "VB"  "DT"  "NNS" "CC"  "VBP"
## [37] "VBG" "NNS" "IN"  "WDT" "NNS" "VBP" "JJ"  "TO"  "VB"  "IN"  "DT"  "NNS"
## [49] "IN"  "DT"  "JJ"  ","   "VBN" "NN"  "."  
## 
## [[18]]
##  [1] "RB"  "DT"  "VBZ" "RB"  "TO"  "VB"  "IN"  "NNS" "VBP" "TO"  "VB"  "NN" 
## [13] "."  
## 
## [[19]]
##  [1] "NNS" "VBP" "VBN" "IN"  "NNS" "IN"  "DT"  "JJ"  "NN"  "NN"  "VBZ" "DT" 
## [13] "JJ"  "NN"  "CC"  "JJ"  "NNS" "."  
## 
## [[20]]
##  [1] "CC"   "NNS"  "MD"   "VB"   "DT"   "JJ"   "NN"   ","    "IN"   "RB"  
## [11] "VBG"  "NN"   "CC"   "VBG"  "DT"   "NN"   "IN"   "NNS"  ","    "IN"  
## [21] "PRP$" "JJ"   "NN"   ","    "VBP"  "DT"   "JJ"   "NN"   "IN"   "NN"  
## [31] "."   
## 
## [[21]]
##  [1] "NN"  "NNS" "TO"  "VB"  "VBN" ","   "CC"  "RB"  "VBD" "IN"  "NN"  "."  
## 
## [[22]]
##  [1] "VB"  "DT"  "NN"  "IN"  "NNS" "DT"  "NN"  "VBZ" "NN"  "TO"  "VB"  "VB" 
## [13] "DT"  "JJ"  "NN"  "IN"  "NN"  ","   "RB"  "NN"  "CC"  "VBD" "NN"  "."  
## 
## [[23]]
##  [1] "NNP" "MD"  "VB"  "VBN" "IN"  "DT"  "NN"  "IN"  "DT"  "JJ"  "NN"  ","  
## [13] "RB"  "VBN" "TO"  "VB"  "PRP" "."  
## 
## [[24]]
##  [1] "NNP" "NN"  "IN"  "JJ"  "NN"  "VBZ" "RB"  "JJ"  "IN"  "PRP" "VBZ" "JJ" 
## [13] ","   "CC"  "DT"  "NNS" "CC"  "DT"  "VBN" "MD"  "VB"  "IN"  "VBG" "PRP"
## [25] "."  
## 
## [[25]]
##  [1] "RB"  ","   "PRP" "MD"  "VB"  "TO"  "VB"  "DT"  "NN"  "IN"  "NN"  "CC" 
## [13] "NN"  ","   "VB"  "JJR" ","   "RBR" "JJ"  "NN"  "NNS" "TO"  "VB"  "JJ" 
## [25] "NN"  "CC"  "JJR" "NNS" "IN"  "NN"  "."   "''"
# 品詞と単語の対応を付けたものにする
sapply(ns502.pos, function(a){paste(a, names(a), sep="_")})
## [[1]]
##  [1] "Considering_VBG" "the_DT"          "heightened_VBN"  "role_NN"        
##  [5] "maintained_VBN"  "by_IN"           "many_JJ"         "in_IN"          
##  [9] "education_NN"    ",_,"             "it_PRP"          "'s_VBZ"         
## [13] "strangely_RB"    "rare_JJ"         "to_TO"           "fin_VBG"        
## [17] "many_JJ"         "willing_JJ"      "to_TO"           "question_VB"    
## [21] "this_DT"         "status_NN"       "quo_NN"          "._."            
## 
## [[2]]
##  [1] "Of_IN"           "course_NN"       ",_,"             "many_JJ"        
##  [5] "aware_JJ"        "of_IN"           "the_DT"          "dynamic_JJ"     
##  [9] "contrast_NN"     "between_IN"      "student_NN"      "and_CC"         
## [13] "teacher_NN"      "are_VBP"         "perfectly_RB"    "willing_JJ"     
## [17] "to_TO"           "perpetuate_VB"   "and_CC"          "even_RB"        
## [21] "strengthen_VB"   "this_DT"         "relationship_NN" "._."            
## 
## [[3]]
##  [1] "It_PRP"      "may_MD"      "seem_VB"     "entirely_RB" "silly_JJ"   
##  [6] ",_,"         "even_RB"     ",_,"         "to_TO"       "consider_VB"
## [11] "that_IN"     "anything_NN" "needs_VBZ"   "to_TO"       "be_VB"      
## [16] "changed_VBN" "._."        
## 
## [[4]]
##  [1] "However_RB"         ",_,"                "with_IN"           
##  [4] "growing_VBG"        "competition_NN"     "in_IN"             
##  [7] "workplaces_NNS"     "and_CC"             "with_IN"           
## [10] "newer_JJR"          "jobs_NNS"           "being_VBG"         
## [13] "developed_VBN"      "on_IN"              "a_DT"              
## [16] "regular_JJ"         "basis_NN"           ",_,"               
## [19] "it_PRP"             "may_MD"             "be_VB"             
## [22] "necessary_JJ"       "to_TO"              "reexamine_VB"      
## [25] "this_DT"            "two-dimensional_JJ" "hierarchy_NN"      
## [28] "in_IN"              "order_NN"           "to_TO"             
## [31] "better_RB"          "prepare_VB"         "students_NNS"      
## [34] "for_IN"             "the_DT"             "changing_VBG"      
## [37] "world_NN"           "._."               
## 
## [[5]]
##  [1] "For_IN"         "years_NNS"      ",_,"            "American_JJ"   
##  [5] "schools_NNS"    "have_VBP"       "maintained_VBN" "a_DT"          
##  [9] "strict_JJ"      "adherence_NN"   "to_TO"          "an_DT"         
## [13] "invisible_JJ"   ",_,"            "ghostly_JJ"     "code_NN"       
## [17] ",_,"            "one_CD"         "that_WDT"       "encourages_VBZ"
## [21] "respect_NN"     "and_CC"         "honor_NN"       "in_IN"         
## [25] "a_DT"           "manner_NN"      "reminiscent_JJ" "of_IN"         
## [29] "both_DT"        "the_DT"         "power_NN"       "structure_NN"  
## [33] "found_VBD"      "in_IN"          "factories_NNS"  "and_CC"        
## [37] "the_DT"         "military_JJ"    "._."           
## 
## [[6]]
##  [1] "Of_IN"            "course_NN"        ",_,"              "American_JJ"     
##  [5] "schools_NNS"      "do_VBP"           "n't_RB"           "echo_VB"         
##  [9] "this_DT"          "tendency_NN"      "nearly_RB"        "as_RB"           
## [13] "intensely_RB"     "as_IN"            "those_DT"         "found_VBN"       
## [17] "in_IN"            "Japan_NNP"        ",_,"              "but_CC"          
## [21] "the_DT"           "elementary_JJ"    "through_IN"       "high_JJ"         
## [25] "school_NN"        "experience_NN"    "is_VBZ"           "one_CD"          
## [29] "defined_VBN"      "by_IN"            "an_DT"            "old-fashioned_JJ"
## [33] "methodology_NN"   "._."             
## 
## [[7]]
##  [1] "Teachers_NNS"    "are_VBP"         "called_VBN"      "by_IN"          
##  [5] "their_PRP$"      "last_JJ"         "name_NN"         ",_,"            
##  [9] "friendliness_NN" "is_VBZ"          "discouraged_VBN" ",_,"            
## [13] "and_CC"          "contact_NN"      ",_,"             "above_IN"       
## [17] "all_DT"          "else_JJ"         ",_,"             "is_VBZ"         
## [21] "highly_RB"       "feared_VBN"      "._."            
## 
## [[8]]
##  [1] "And_CC"               "yet_RB"               ",_,"                 
##  [4] "all_DT"               "of_IN"                "this_DT"             
##  [7] "changes_NNS"          "once_IN"              "Americans_NNPS"      
## [10] "enter_VBP"            "universities_NNS"     ",_,"                 
## [13] "where_WRB"            "the_DT"               "professor-student_JJ"
## [16] "roles_NNS"            "often_RB"             "evaporate_VB"        
## [19] ",_,"                  "save_VB"              "for_IN"              
## [22] "the_DT"               "minority_NN"          "of_IN"               
## [25] "more_RBR"             "conservative_JJ"      "circumstances_NNS"   
## [28] "._."                 
## 
## [[9]]
##  [1] "Many_JJ"        "professors_NNS" "are_VBP"        "willing_JJ"    
##  [5] "to_TO"          "acknowledge_VB" "that_IN"        "their_PRP$"    
##  [9] "students_NNS"   "have_VBP"       "long_RB"        "since_IN"      
## [13] "passed_VBN"     "the_DT"         "line_NN"        "into_IN"       
## [17] "adulthood_NN"   "and_CC"         "are_VBP"        "willing_JJ"    
## [21] "to_TO"          "share_VB"       "their_PRP$"     "normal_JJ"     
## [25] "array_NN"       "of_IN"          "social_JJ"      "tendencies_NNS"
## [29] "with_IN"        "them_PRP"       "._."           
## 
## [[10]]
##  [1] "It_PRP"            "'s_VBZ"            "not_RB"           
##  [4] "uncommon_JJ"       "for_IN"            "professors_NNS"   
##  [7] "to_TO"             "invite_VB"         "students_NNS"     
## [10] "out_IN"            "for_IN"            "drinks_NNS"       
## [13] "to_TO"             "discuss_VB"        "course_NN"        
## [16] "material_NN"       ",_,"               "or_CC"            
## [19] "even_RB"           "to_TO"             "engage_VB"        
## [22] "in_IN"             "openly_RB"         "accepted_VBN"     
## [25] "romantic_JJ"       "relationships_NNS" "._."              
## 
## [[11]]
##  [1] "To_TO"          "many_JJ"        "foreigners_NNS" "studying_VBG"  
##  [5] "in_IN"          "America_NNP"    ",_,"            "this_DT"       
##  [9] "may_MD"         "seem_VB"        "wildly_RB"      "anarchistic_JJ"
## [13] "and_CC"         "highly_RB"      "vulnerable_JJ"  "to_TO"         
## [17] "abuse_NN"       "._."           
## 
## [[12]]
##  [1] "Whenever_WRB"         "I_PRP"                "tell_VBP"            
##  [4] "stories_NNS"          "of_IN"                "professor-student_JJ"
##  [7] "relationships_NNS"    "to_TO"                "French_JJ"           
## [10] "students_NNS"         ",_,"                  "especially_RB"       
## [13] ",_,"                  "their_PRP$"           "first_JJ"            
## [16] "reaction_NN"          "is_VBZ"               "to_TO"               
## [19] "assume_VB"            "that_IN"              "this_DT"             
## [22] "means_VBZ"            "many_JJ"              "professors_NNS"      
## [25] "must_MD"              "abuse_VB"             "this_DT"             
## [28] "open_JJ"              "attitude_NN"          "to_TO"               
## [31] "gain_VB"              "\\\"special_JJ"       "favors_NNS"          
## [34] "\\_RB"                "\"_''"                "in_IN"               
## [37] "return_NN"            "for_IN"               "favoritism_NN"       
## [40] "._."                 
## 
## [[13]]
##  [1] "While_IN"        "I_PRP"           "ca_MD"           "n't_RB"         
##  [5] ",_,"             "of_IN"           "course_NN"       ",_,"            
##  [9] "claim_NN"        "that_IN"         "the_DT"          "chances_NNS"    
## [13] "of_IN"           "this_DT"         "occurring_VBG"   "are_VBP"        
## [17] "nested_VBN"      "at_IN"           "a_DT"            "safe_JJ"        
## [21] "zero_CD"         "percent_NN"      ",_,"             "I_PRP"          
## [25] "can_MD"          "say_VB"          "that_IN"         "this_DT"        
## [29] "attitude_NN"     "stems_VBZ"       "more_RBR"        "from_IN"        
## [33] "professors_NNS"  "'_POS"           "willingness_NN"  "to_TO"          
## [37] "see_VB"          "their_PRP$"      "students_NNS"    "as_IN"          
## [41] "intellectual_JJ" "equals_NNS"      "._."            
## 
## [[14]]
##  [1] "So_RB"         "why_WRB"       ",_,"           "then_RB"      
##  [5] ",_,"           "are_VBP"       "we_PRP"        "leaving_VBG"  
##  [9] "our_PRP$"      "students_NNS"  "so_RB"         "unprepared_JJ"
## [13] "for_IN"        "such_JJ"       "an_DT"         "atmosphere_NN"
## [17] "?_."          
## 
## [[15]]
##  [1] "Perhaps_RB"    "it_PRP"        "'s_VBZ"        "because_IN"   
##  [5] "grade_NN"      "school_NN"     "teachers_NNS"  "are_VBP"      
##  [9] "so_RB"         "far_RB"        "removed_VBN"   "from_IN"      
## [13] "the_DT"        "college_NN"    "experience_NN" "that_IN"      
## [17] "they_PRP"      "'ve_VBP"       "forgotten_VBN" ",_,"          
## [21] "or_CC"         "perhaps_RB"    "proceeded_VBD" ",_,"          
## [25] "the_DT"        "loose_JJ"      "roles_NNS"     "found_VBD"    
## [29] "in_IN"         "the_DT"        "college_NN"    "setting_NN"   
## [33] "._."          
## 
## [[16]]
##  [1] "Speaking_VBG"  "from_IN"       "experience_NN" ",_,"          
##  [5] "I_PRP"         "can_MD"        "absolutely_RB" "say_VB"       
##  [9] "that_IN"       "I_PRP"         "'m_VBP"        "far_RB"       
## [13] "more_JJR"      "eager_JJ"      "to_TO"         "engage_VB"    
## [17] "with_IN"       "material_NN"   "when_WRB"      "the_DT"       
## [21] "voice_NN"      "educating_VBG" "me_PRP"        "treats_VBZ"   
## [25] "me_PRP"        "like_IN"       "a_DT"          "sentient_NN"  
## [29] ",_,"           "thinking_VBG"  "individual_JJ" ",_,"          
## [33] "and_CC"        "not_RB"        "just_RB"       "a_DT"         
## [37] "sieve_NN"      "or_CC"         "receptor_NN"   "ready_JJ"     
## [41] "to_TO"         "accept_VB"     "input_NN"      "but_CC"       
## [45] "offer_NN"      "no_DT"         "active_JJ"     "response_NN"  
## [49] "._."          
## 
## [[17]]
##  [1] "Students_NNS"    "are_VBP"         "not_RB"          "merely_RB"      
##  [5] "plants_NNS"      "to_TO"           "be_VB"           "grown_VBN"      
##  [9] "but_CC"          "people_NNS"      "to_TO"           "be_VB"          
## [13] "challenged_VBN"  "and_CC"          "to_TO"           "challenge_VB"   
## [17] ",_,"             "and_CC"          "the_DT"          "first_JJ"       
## [21] "step_NN"         "to_TO"           "instituting_VBG" "this_DT"        
## [25] "change_NN"       "in_IN"           "the_DT"          "educational_JJ" 
## [29] "environment_NN"  "is_VBZ"          "to_TO"           "stop_VB"        
## [33] "the_DT"          "formalities_NNS" "and_CC"          "create_VBP"     
## [37] "teaching_VBG"    "atmospheres_NNS" "in_IN"           "which_WDT"      
## [41] "students_NNS"    "are_VBP"         "welcome_JJ"      "to_TO"          
## [45] "interact_VB"     "with_IN"         "the_DT"          "teachers_NNS"   
## [49] "from_IN"         "a_DT"            "common_JJ"       ",_,"            
## [53] "shared_VBN"      "viewpoint_NN"    "._."            
## 
## [[18]]
##  [1] "Now_RB"       "this_DT"      "is_VBZ"       "not_RB"       "to_TO"       
##  [6] "say_VB"       "that_IN"      "teachers_NNS" "need_VBP"     "to_TO"       
## [11] "abandon_VB"   "authority_NN" "._."         
## 
## [[19]]
##  [1] "Psychologists_NNS" "have_VBP"          "speculated_VBN"   
##  [4] "for_IN"            "years_NNS"         "that_IN"          
##  [7] "the_DT"            "proper_JJ"         "parenting_NN"     
## [10] "method_NN"         "involves_VBZ"      "both_DT"          
## [13] "active_JJ"         "discussion_NN"     "and_CC"           
## [16] "steady_JJ"         "rules_NNS"         "._."              
## 
## [[20]]
##  [1] "But_CC"           "rules_NNS"        "must_MD"          "serve_VB"        
##  [5] "a_DT"             "distinct_JJ"      "purpose_NN"       ",_,"             
##  [9] "beyond_IN"        "merely_RB"        "establishing_VBG" "dominance_NN"    
## [13] "or_CC"            "perpetuating_VBG" "the_DT"           "fallacy_NN"      
## [17] "that_IN"          "rules_NNS"        ",_,"              "by_IN"           
## [21] "their_PRP$"       "own_JJ"           "virtue_NN"        ",_,"             
## [25] "are_VBP"          "the_DT"           "end-all_JJ"       "source_NN"       
## [29] "of_IN"            "compliance_NN"    "._."             
## 
## [[21]]
##  [1] "Allow_NN"       "rules_NNS"      "to_TO"          "be_VB"         
##  [5] "challenged_VBN" ",_,"            "and_CC"         "even_RB"       
##  [9] "changed_VBD"    "on_IN"          "occasion_NN"    "._."           
## 
## [[22]]
##  [1] "Let_VB"           "the_DT"           "wealth_NN"        "of_IN"           
##  [5] "perspectives_NNS" "a_DT"             "teacher_NN"       "has_VBZ"         
##  [9] "access_NN"        "to_TO"            "help_VB"          "establish_VB"    
## [13] "the_DT"           "right_JJ"         "course_NN"        "of_IN"           
## [17] "action_NN"        ",_,"              "not_RB"           "tradition_NN"    
## [21] "or_CC"            "assumed_VBD"      "patronage_NN"     "._."             
## 
## [[23]]
##  [1] "Education_NNP" "should_MD"     "be_VB"         "defined_VBN"  
##  [5] "by_IN"         "the_DT"        "fluidity_NN"   "of_IN"        
##  [9] "the_DT"        "human_JJ"      "experience_NN" ",_,"          
## [13] "not_RB"        "built_VBN"     "to_TO"         "oppose_VB"    
## [17] "it_PRP"        "._."          
## 
## [[24]]
##  [1] "Supreme_NNP"   "authority_NN"  "without_IN"    "equal_JJ"     
##  [5] "exchange_NN"   "is_VBZ"        "as_RB"         "unnatural_JJ" 
##  [9] "as_IN"         "it_PRP"        "is_VBZ"        "futile_JJ"    
## [13] ",_,"           "and_CC"        "both_DT"       "educators_NNS"
## [17] "and_CC"        "the_DT"        "educated_VBN"  "would_MD"     
## [21] "benefit_VB"    "from_IN"       "avoiding_VBG"  "it_PRP"       
## [25] "._."          
## 
## [[25]]
##  [1] "Instead_RB"      ",_,"             "we_PRP"          "should_MD"      
##  [5] "yearn_VB"        "to_TO"           "construct_VB"    "a_DT"           
##  [9] "bridge_NN"       "between_IN"      "student_NN"      "and_CC"         
## [13] "teacher_NN"      ",_,"             "create_VB"       "closer_JJR"     
## [17] ",_,"             "more_RBR"        "equal_JJ"        "power_NN"       
## [21] "structures_NNS"  "to_TO"           "create_VB"       "wholehearted_JJ"
## [25] "inspiration_NN"  "and_CC"          "higher_JJR"      "rates_NNS"      
## [29] "of_IN"           "success_NN"      "._."             "\"_''"
ns502.tagged <- sapply(ns502.pos, function(a){paste(a, names(a), sep="_")})

タグ付きのテキストデータで検索する

head(ns502.tagged)
## [[1]]
##  [1] "Considering_VBG" "the_DT"          "heightened_VBN"  "role_NN"        
##  [5] "maintained_VBN"  "by_IN"           "many_JJ"         "in_IN"          
##  [9] "education_NN"    ",_,"             "it_PRP"          "'s_VBZ"         
## [13] "strangely_RB"    "rare_JJ"         "to_TO"           "fin_VBG"        
## [17] "many_JJ"         "willing_JJ"      "to_TO"           "question_VB"    
## [21] "this_DT"         "status_NN"       "quo_NN"          "._."            
## 
## [[2]]
##  [1] "Of_IN"           "course_NN"       ",_,"             "many_JJ"        
##  [5] "aware_JJ"        "of_IN"           "the_DT"          "dynamic_JJ"     
##  [9] "contrast_NN"     "between_IN"      "student_NN"      "and_CC"         
## [13] "teacher_NN"      "are_VBP"         "perfectly_RB"    "willing_JJ"     
## [17] "to_TO"           "perpetuate_VB"   "and_CC"          "even_RB"        
## [21] "strengthen_VB"   "this_DT"         "relationship_NN" "._."            
## 
## [[3]]
##  [1] "It_PRP"      "may_MD"      "seem_VB"     "entirely_RB" "silly_JJ"   
##  [6] ",_,"         "even_RB"     ",_,"         "to_TO"       "consider_VB"
## [11] "that_IN"     "anything_NN" "needs_VBZ"   "to_TO"       "be_VB"      
## [16] "changed_VBN" "._."        
## 
## [[4]]
##  [1] "However_RB"         ",_,"                "with_IN"           
##  [4] "growing_VBG"        "competition_NN"     "in_IN"             
##  [7] "workplaces_NNS"     "and_CC"             "with_IN"           
## [10] "newer_JJR"          "jobs_NNS"           "being_VBG"         
## [13] "developed_VBN"      "on_IN"              "a_DT"              
## [16] "regular_JJ"         "basis_NN"           ",_,"               
## [19] "it_PRP"             "may_MD"             "be_VB"             
## [22] "necessary_JJ"       "to_TO"              "reexamine_VB"      
## [25] "this_DT"            "two-dimensional_JJ" "hierarchy_NN"      
## [28] "in_IN"              "order_NN"           "to_TO"             
## [31] "better_RB"          "prepare_VB"         "students_NNS"      
## [34] "for_IN"             "the_DT"             "changing_VBG"      
## [37] "world_NN"           "._."               
## 
## [[5]]
##  [1] "For_IN"         "years_NNS"      ",_,"            "American_JJ"   
##  [5] "schools_NNS"    "have_VBP"       "maintained_VBN" "a_DT"          
##  [9] "strict_JJ"      "adherence_NN"   "to_TO"          "an_DT"         
## [13] "invisible_JJ"   ",_,"            "ghostly_JJ"     "code_NN"       
## [17] ",_,"            "one_CD"         "that_WDT"       "encourages_VBZ"
## [21] "respect_NN"     "and_CC"         "honor_NN"       "in_IN"         
## [25] "a_DT"           "manner_NN"      "reminiscent_JJ" "of_IN"         
## [29] "both_DT"        "the_DT"         "power_NN"       "structure_NN"  
## [33] "found_VBD"      "in_IN"          "factories_NNS"  "and_CC"        
## [37] "the_DT"         "military_JJ"    "._."           
## 
## [[6]]
##  [1] "Of_IN"            "course_NN"        ",_,"              "American_JJ"     
##  [5] "schools_NNS"      "do_VBP"           "n't_RB"           "echo_VB"         
##  [9] "this_DT"          "tendency_NN"      "nearly_RB"        "as_RB"           
## [13] "intensely_RB"     "as_IN"            "those_DT"         "found_VBN"       
## [17] "in_IN"            "Japan_NNP"        ",_,"              "but_CC"          
## [21] "the_DT"           "elementary_JJ"    "through_IN"       "high_JJ"         
## [25] "school_NN"        "experience_NN"    "is_VBZ"           "one_CD"          
## [29] "defined_VBN"      "by_IN"            "an_DT"            "old-fashioned_JJ"
## [33] "methodology_NN"   "._."
# リストの各要素、つまり文ごとに、その中の要素を、スペースを挟んで貼り付ける
ns502.tagged.data <- sapply(ns502.tagged, paste, collapse=" ")

write(ns502.tagged.data, "ns502.tagged.data.txt")

head(ns502.tagged.data)
## [1] "Considering_VBG the_DT heightened_VBN role_NN maintained_VBN by_IN many_JJ in_IN education_NN ,_, it_PRP 's_VBZ strangely_RB rare_JJ to_TO fin_VBG many_JJ willing_JJ to_TO question_VB this_DT status_NN quo_NN ._."                                                                                                                                          
## [2] "Of_IN course_NN ,_, many_JJ aware_JJ of_IN the_DT dynamic_JJ contrast_NN between_IN student_NN and_CC teacher_NN are_VBP perfectly_RB willing_JJ to_TO perpetuate_VB and_CC even_RB strengthen_VB this_DT relationship_NN ._."                                                                                                                                 
## [3] "It_PRP may_MD seem_VB entirely_RB silly_JJ ,_, even_RB ,_, to_TO consider_VB that_IN anything_NN needs_VBZ to_TO be_VB changed_VBN ._."                                                                                                                                                                                                                        
## [4] "However_RB ,_, with_IN growing_VBG competition_NN in_IN workplaces_NNS and_CC with_IN newer_JJR jobs_NNS being_VBG developed_VBN on_IN a_DT regular_JJ basis_NN ,_, it_PRP may_MD be_VB necessary_JJ to_TO reexamine_VB this_DT two-dimensional_JJ hierarchy_NN in_IN order_NN to_TO better_RB prepare_VB students_NNS for_IN the_DT changing_VBG world_NN ._."
## [5] "For_IN years_NNS ,_, American_JJ schools_NNS have_VBP maintained_VBN a_DT strict_JJ adherence_NN to_TO an_DT invisible_JJ ,_, ghostly_JJ code_NN ,_, one_CD that_WDT encourages_VBZ respect_NN and_CC honor_NN in_IN a_DT manner_NN reminiscent_JJ of_IN both_DT the_DT power_NN structure_NN found_VBD in_IN factories_NNS and_CC the_DT military_JJ ._."     
## [6] "Of_IN course_NN ,_, American_JJ schools_NNS do_VBP n't_RB echo_VB this_DT tendency_NN nearly_RB as_RB intensely_RB as_IN those_DT found_VBN in_IN Japan_NNP ,_, but_CC the_DT elementary_JJ through_IN high_JJ school_NN experience_NN is_VBZ one_CD defined_VBN by_IN an_DT old-fashioned_JJ methodology_NN ._."
grep("_JJ \\w+_NN", ns502.tagged.data, value=T)
##  [1] "Of_IN course_NN ,_, many_JJ aware_JJ of_IN the_DT dynamic_JJ contrast_NN between_IN student_NN and_CC teacher_NN are_VBP perfectly_RB willing_JJ to_TO perpetuate_VB and_CC even_RB strengthen_VB this_DT relationship_NN ._."                                                                                                                                                                                                                                                                                      
##  [2] "However_RB ,_, with_IN growing_VBG competition_NN in_IN workplaces_NNS and_CC with_IN newer_JJR jobs_NNS being_VBG developed_VBN on_IN a_DT regular_JJ basis_NN ,_, it_PRP may_MD be_VB necessary_JJ to_TO reexamine_VB this_DT two-dimensional_JJ hierarchy_NN in_IN order_NN to_TO better_RB prepare_VB students_NNS for_IN the_DT changing_VBG world_NN ._."                                                                                                                                                     
##  [3] "For_IN years_NNS ,_, American_JJ schools_NNS have_VBP maintained_VBN a_DT strict_JJ adherence_NN to_TO an_DT invisible_JJ ,_, ghostly_JJ code_NN ,_, one_CD that_WDT encourages_VBZ respect_NN and_CC honor_NN in_IN a_DT manner_NN reminiscent_JJ of_IN both_DT the_DT power_NN structure_NN found_VBD in_IN factories_NNS and_CC the_DT military_JJ ._."                                                                                                                                                          
##  [4] "Of_IN course_NN ,_, American_JJ schools_NNS do_VBP n't_RB echo_VB this_DT tendency_NN nearly_RB as_RB intensely_RB as_IN those_DT found_VBN in_IN Japan_NNP ,_, but_CC the_DT elementary_JJ through_IN high_JJ school_NN experience_NN is_VBZ one_CD defined_VBN by_IN an_DT old-fashioned_JJ methodology_NN ._."                                                                                                                                                                                                   
##  [5] "Teachers_NNS are_VBP called_VBN by_IN their_PRP$ last_JJ name_NN ,_, friendliness_NN is_VBZ discouraged_VBN ,_, and_CC contact_NN ,_, above_IN all_DT else_JJ ,_, is_VBZ highly_RB feared_VBN ._."                                                                                                                                                                                                                                                                                                                  
##  [6] "And_CC yet_RB ,_, all_DT of_IN this_DT changes_NNS once_IN Americans_NNPS enter_VBP universities_NNS ,_, where_WRB the_DT professor-student_JJ roles_NNS often_RB evaporate_VB ,_, save_VB for_IN the_DT minority_NN of_IN more_RBR conservative_JJ circumstances_NNS ._."                                                                                                                                                                                                                                          
##  [7] "Many_JJ professors_NNS are_VBP willing_JJ to_TO acknowledge_VB that_IN their_PRP$ students_NNS have_VBP long_RB since_IN passed_VBN the_DT line_NN into_IN adulthood_NN and_CC are_VBP willing_JJ to_TO share_VB their_PRP$ normal_JJ array_NN of_IN social_JJ tendencies_NNS with_IN them_PRP ._."                                                                                                                                                                                                                 
##  [8] "It_PRP 's_VBZ not_RB uncommon_JJ for_IN professors_NNS to_TO invite_VB students_NNS out_IN for_IN drinks_NNS to_TO discuss_VB course_NN material_NN ,_, or_CC even_RB to_TO engage_VB in_IN openly_RB accepted_VBN romantic_JJ relationships_NNS ._."                                                                                                                                                                                                                                                               
##  [9] "To_TO many_JJ foreigners_NNS studying_VBG in_IN America_NNP ,_, this_DT may_MD seem_VB wildly_RB anarchistic_JJ and_CC highly_RB vulnerable_JJ to_TO abuse_NN ._."                                                                                                                                                                                                                                                                                                                                                  
## [10] "Whenever_WRB I_PRP tell_VBP stories_NNS of_IN professor-student_JJ relationships_NNS to_TO French_JJ students_NNS ,_, especially_RB ,_, their_PRP$ first_JJ reaction_NN is_VBZ to_TO assume_VB that_IN this_DT means_VBZ many_JJ professors_NNS must_MD abuse_VB this_DT open_JJ attitude_NN to_TO gain_VB \\\"special_JJ favors_NNS \\_RB \"_'' in_IN return_NN for_IN favoritism_NN ._."                                                                                                                          
## [11] "While_IN I_PRP ca_MD n't_RB ,_, of_IN course_NN ,_, claim_NN that_IN the_DT chances_NNS of_IN this_DT occurring_VBG are_VBP nested_VBN at_IN a_DT safe_JJ zero_CD percent_NN ,_, I_PRP can_MD say_VB that_IN this_DT attitude_NN stems_VBZ more_RBR from_IN professors_NNS '_POS willingness_NN to_TO see_VB their_PRP$ students_NNS as_IN intellectual_JJ equals_NNS ._."                                                                                                                                          
## [12] "Perhaps_RB it_PRP 's_VBZ because_IN grade_NN school_NN teachers_NNS are_VBP so_RB far_RB removed_VBN from_IN the_DT college_NN experience_NN that_IN they_PRP 've_VBP forgotten_VBN ,_, or_CC perhaps_RB proceeded_VBD ,_, the_DT loose_JJ roles_NNS found_VBD in_IN the_DT college_NN setting_NN ._."                                                                                                                                                                                                              
## [13] "Speaking_VBG from_IN experience_NN ,_, I_PRP can_MD absolutely_RB say_VB that_IN I_PRP 'm_VBP far_RB more_JJR eager_JJ to_TO engage_VB with_IN material_NN when_WRB the_DT voice_NN educating_VBG me_PRP treats_VBZ me_PRP like_IN a_DT sentient_NN ,_, thinking_VBG individual_JJ ,_, and_CC not_RB just_RB a_DT sieve_NN or_CC receptor_NN ready_JJ to_TO accept_VB input_NN but_CC offer_NN no_DT active_JJ response_NN ._."                                                                                     
## [14] "Students_NNS are_VBP not_RB merely_RB plants_NNS to_TO be_VB grown_VBN but_CC people_NNS to_TO be_VB challenged_VBN and_CC to_TO challenge_VB ,_, and_CC the_DT first_JJ step_NN to_TO instituting_VBG this_DT change_NN in_IN the_DT educational_JJ environment_NN is_VBZ to_TO stop_VB the_DT formalities_NNS and_CC create_VBP teaching_VBG atmospheres_NNS in_IN which_WDT students_NNS are_VBP welcome_JJ to_TO interact_VB with_IN the_DT teachers_NNS from_IN a_DT common_JJ ,_, shared_VBN viewpoint_NN ._."
## [15] "Psychologists_NNS have_VBP speculated_VBN for_IN years_NNS that_IN the_DT proper_JJ parenting_NN method_NN involves_VBZ both_DT active_JJ discussion_NN and_CC steady_JJ rules_NNS ._."                                                                                                                                                                                                                                                                                                                             
## [16] "But_CC rules_NNS must_MD serve_VB a_DT distinct_JJ purpose_NN ,_, beyond_IN merely_RB establishing_VBG dominance_NN or_CC perpetuating_VBG the_DT fallacy_NN that_IN rules_NNS ,_, by_IN their_PRP$ own_JJ virtue_NN ,_, are_VBP the_DT end-all_JJ source_NN of_IN compliance_NN ._."                                                                                                                                                                                                                               
## [17] "Let_VB the_DT wealth_NN of_IN perspectives_NNS a_DT teacher_NN has_VBZ access_NN to_TO help_VB establish_VB the_DT right_JJ course_NN of_IN action_NN ,_, not_RB tradition_NN or_CC assumed_VBD patronage_NN ._."                                                                                                                                                                                                                                                                                                   
## [18] "Education_NNP should_MD be_VB defined_VBN by_IN the_DT fluidity_NN of_IN the_DT human_JJ experience_NN ,_, not_RB built_VBN to_TO oppose_VB it_PRP ._."                                                                                                                                                                                                                                                                                                                                                             
## [19] "Supreme_NNP authority_NN without_IN equal_JJ exchange_NN is_VBZ as_RB unnatural_JJ as_IN it_PRP is_VBZ futile_JJ ,_, and_CC both_DT educators_NNS and_CC the_DT educated_VBN would_MD benefit_VB from_IN avoiding_VBG it_PRP ._."                                                                                                                                                                                                                                                                                   
## [20] "Instead_RB ,_, we_PRP should_MD yearn_VB to_TO construct_VB a_DT bridge_NN between_IN student_NN and_CC teacher_NN ,_, create_VB closer_JJR ,_, more_RBR equal_JJ power_NN structures_NNS to_TO create_VB wholehearted_JJ inspiration_NN and_CC higher_JJR rates_NNS of_IN success_NN ._. \"_''"
  • grepでは、検索文字列を含む要素(文)全体が出力される

stringrパッケージの利用

install.packages("stringr", dependencies=T)
library(stringr)

stringrパッケージの機能を使って該当文字列だけの検索

https://sugiura-ken.org/wiki/wiki.cgi/exp?page=grepExtract * これを修正

grepExtract2 <- function(a,b){
  # stringrパッケージ利用
  #copyleft 2020-12-20 sugiura@nagoya-u.jp
  # grepExtract2("検索文字列", データ)
  
  hit.all <- ""
    
    hit <- str_extract(b, a)
    
    hit.all <- c(hit.all, hit)
    
  
  hit.all
}

実行例

grepExtract2("\\w+_JJ \\w+_NN", ns502.tagged.data)
##  [1] ""                             NA                            
##  [3] "dynamic_JJ contrast_NN"       NA                            
##  [5] "regular_JJ basis_NN"          "American_JJ schools_NN"      
##  [7] "American_JJ schools_NN"       "last_JJ name_NN"             
##  [9] "student_JJ roles_NN"          "Many_JJ professors_NN"       
## [11] "romantic_JJ relationships_NN" "many_JJ foreigners_NN"       
## [13] "student_JJ relationships_NN"  "intellectual_JJ equals_NN"   
## [15] NA                             "loose_JJ roles_NN"           
## [17] "active_JJ response_NN"        "first_JJ step_NN"            
## [19] NA                             "proper_JJ parenting_NN"      
## [21] "distinct_JJ purpose_NN"       NA                            
## [23] "right_JJ course_NN"           "human_JJ experience_NN"      
## [25] "equal_JJ exchange_NN"         "equal_JJ power_NN"