njtierney / syn

syn - the thesaurus
http://syn.njtierney.com/
51 stars 4 forks source link

a representative word for each list #30

Open qomhmd opened 11 months ago

qomhmd commented 11 months ago

As a feature request, I should say that having a "default" word which represents the list of synonyms or antonyms of each word may be good for the sake of reproducibility and NLP sentiment analysis. Thank you for the package.

njtierney commented 11 months ago

Hey there - I think this is already done inside of syns and ants:

library(syn)

syn_thanks_awesome <- syns(c("thanks", "awesome"))

names(syn_thanks_awesome)
#> [1] "thanks"  "awesome"
syn_thanks_awesome$thanks
#>  [1] "acknowledgment"   "aid prayer"       "Angelus"          "appeal"          
#>  [5] "Ave"              "Ave Maria"        "beadroll"         "beads"           
#>  [9] "benediction"      "beseechment"      "bidding prayer"   "blessing"        
#> [13] "breviary"         "chaplet"          "cognizance"       "collect"         
#> [17] "communion"        "contemplation"    "credit"           "crediting"       
#> [21] "devotions"        "entreaty"         "grace"            "Hail Mary"       
#> [25] "hymn"             "impetration"      "imploration"      "intercession"    
#> [29] "invocation"       "Kyrie Eleison"    "litany"           "meditation"      
#> [33] "obsecration"      "obtestation"      "orison"           "paean"           
#> [37] "Paternoster"      "petition"         "praise"           "prayer"          
#> [41] "prayer of thanks" "prayer wheel"     "recognition"      "rogation"        
#> [45] "rosary"           "silent prayer"    "suit"             "supplication"    
#> [49] "thank offering"   "thank-you"        "thanks"           "thanksgiving"
syn_thanks_awesome$awesome
#>   [1] "affecting"       "aggrandized"     "alarming"        "amazing"        
#>   [5] "amplitudinous"   "apotheosized"    "appalling"       "astonishing"    
#>   [9] "astounding"      "astronomical"    "august"          "awe-inspiring"  
#>  [13] "awesome"         "awful"           "awing"           "beatified"      
#>  [17] "big"             "bizarre"         "boundless"       "breathtaking"   
#>  [21] "bulky"           "canonized"       "colossal"        "cosmic"         
#>  [25] "daunting"        "deified"         "dire"            "direful"        
#>  [29] "divine"          "dread"           "dreaded"         "dreadful"       
#>  [33] "eerie"           "elevated"        "eminent"         "ennobled"       
#>  [37] "enormous"        "enshrined"       "enthroned"       "estimable"      
#>  [41] "exalted"         "excellent"       "extensive"       "fearful"        
#>  [45] "fearsome"        "fell"            "formidable"      "frightening"    
#>  [49] "galactic"        "Gargantuan"      "ghastly"         "ghoulish"       
#>  [53] "gigantic"        "glorified"       "grand"           "great"          
#>  [57] "grim"            "grisly"          "gruesome"        "heavenly"       
#>  [61] "held in awe"     "hideous"         "high"            "high and mighty"
#>  [65] "holy"            "honorable"       "horrendous"      "horrible"       
#>  [69] "horrid"          "horrific"        "horrifying"      "huge"           
#>  [73] "immeasurable"    "immense"         "immortal"        "immortalized"   
#>  [77] "imposing"        "incredible"      "ineffable"       "inenarrable"    
#>  [81] "inexpressible"   "infinite"        "inviolable"      "inviolate"      
#>  [85] "king-size"       "large"           "lofty"           "macabre"        
#>  [89] "magnified"       "mammoth"         "massive"         "massy"          
#>  [93] "mighty"          "monster"         "monstrous"       "monumental"     
#>  [97] "morbid"          "mountainous"     "moving"          "mysterious"     
#> [101] "numinous"        "outsize"         "overgrown"       "overwhelming"   
#> [105] "prodigious"      "redoubtable"     "religious"       "reverend"       
#> [109] "sacred"          "sacrosanct"      "sainted"         "sanctified"     
#> [113] "schrecklich"     "shocking"        "shrined"         "sizable"        
#> [117] "spacious"        "spiritual"       "stirring"        "stunning"       
#> [121] "stupefying"      "stupendous"      "sublime"         "supereminent"   
#> [125] "terrible"        "terrific"        "terrifying"      "throned"        
#> [129] "time-honored"    "titanic"         "tremendous"      "unbelievable"   
#> [133] "uncanny"         "unspeakable"     "untouchable"     "unutterable"    
#> [137] "vast"            "venerable"       "voluminous"      "weighty"        
#> [141] "weird"           "wonderful"       "wondrous"        "worshipful"

ant_cool_good <- ants(c("cool", "good"))

names(ant_cool_good)
#> [1] "cool" "good"
ant_cool_good$cool
#> [1] "heat" "warm"
ant_cool_good$good
#> [1] "bad"  "evil"

Created on 2023-12-01 with reprex v2.0.2

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.3.2 (2023-10-31) #> os macOS Sonoma 14.0 #> system aarch64, darwin20 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Australia/Hobart #> date 2023-12-01 #> pandoc 3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.0) #> digest 0.6.33 2023-07-07 [1] CRAN (R 4.3.0) #> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.1) #> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) #> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.0) #> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1) #> knitr 1.45 2023-10-30 [1] CRAN (R 4.3.1) #> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) #> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.3.0) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.3.0) #> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.3.0) #> R.utils 2.12.2 2022-11-11 [1] CRAN (R 4.3.0) #> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.3.0) #> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.0) #> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.1) #> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) #> styler 1.9.1 2023-03-04 [1] CRAN (R 4.3.0) #> syn * 0.1.0 2023-11-09 [1] local #> vctrs 0.6.4 2023-10-12 [1] CRAN (R 4.3.1) #> withr 2.5.2 2023-10-30 [1] CRAN (R 4.3.1) #> xfun 0.41 2023-11-01 [1] CRAN (R 4.3.1) #> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.3.0) #> #> [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library #> #> ────────────────────────────────────────────────────────────────────────────── ```

Does this cover what you wanted, or were you asking about syn or ant? If you want the same output but for one word you can use syns or ants but just provide one word.

Let me know if this answers your question :)