Synonyms from wordnet package are very incomplete

。_饼干妹妹 提交于 2019-12-13 02:55:52

问题


Synonyms function of wordnet package misses obvious synonyms that the wordnet app does not. How to get that other data out of wordnet using R's wordnet package?

I am using R 3.4.4. App shows 9 senses of company

Sense 1 company -- (an institution created to conduct business; "he only invests in large well-established companies"; "he started the company in his garage") => institution, establishment -- (an organization founded and united for a specific purpose) Sense 2 company -- (small military unit; usually two or three platoons) => army unit -- (a military unit that is part of an army)

Sense 3 company, companionship, fellowship, society -- (the state of being with someone; "he missed their company"; "he enjoyed the society of his friends") => friendship, friendly relationship -- (the state of being friends (or friendly))

```R  
    syns<-vector()
    filter <- getTermFilter("ExactMatchFilter", "company", TRUE)
    for(i in c("ADJECTIVE", "ADVERB", "NOUN",  "VERB")){
      try({
        terms <- getIndexTerms( i, 1, filter)
        gsyn<-getSynonyms(terms[[1]])
        synsets <- getSynsets(terms[[1]])
        related <- getRelatedSynsets(synsets[[1]], "+")
        gsyn <- c(gsyn,unlist(sapply(related, getWord)))
        if(length(gsyn)>0){
         syns <- c(syns,i)
         syns <- c(syns,unique(gsyn))
        }
      }, silent = T)
    }
    print(syns)
```  

 [1] "NOUN"             "caller"          
 [3] "companionship"    "company"         
 [5] "fellowship"       "party"           
 [7] "ship's company"   "society"         
 [9] "troupe"           "VERB"            
[11] "accompany"        "companion"       
[13] "company"          "keep company"    
[15] "escort"           "accompaniment"   
[17] "fellow traveler"  "fellow traveller"
[19] "comrade"          "fellow"          
[21] "familiar"         "associate"       
[23] "party"      

Neither suggest business or => institution, establishment. Sense 3s " company, companionship, fellowship, society " all show up.

来源:https://stackoverflow.com/questions/58194311/synonyms-from-wordnet-package-are-very-incomplete

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!