1.0.21 • Published 1 year ago

words-pt v1.0.21

Weekly downloads
9
License
GPL-3.0
Repository
github
Last release
1 year ago

Node.js CI CodeQL Security Check Coverage Status Known Vulnerabilities js-standard-style Donate with librepay Donate with librepay

The list of all the words in Portuguese, including all possible combinations and variations (masculine, feminine, plural, singular, verbal conjugations, etc.). This is based on the great work from the professors of the University of Minho, and the all the files can be accessed here.

how to use

Install it

npm i words-pt

and then use the API

const wordsPt = require('words-pt')

// { removeNames: true } removes names such as 'Lisboa' or 'António'
wordsPt.init({ removeNames: true }, err => {
  if (err) {
    // handle the error
    return
  }
  wordsPt.isWord('ser') // true
  wordsPt.isWord('serei') // true
  wordsPt.isWord('abafar-nos-ão') // true
  wordsPt.isWord('hello') // false

  wordsPt.randomWord() // grafonolas (any random word)
  wordsPt.randomWord('a') // amealhará (starting with 'a')
  wordsPt.randomWord('abc') // abcissa (starting with 'abc')
  // words.Pt.randomWord('abc') is equivalent to words.Pt.randomWord('abc', '*', '*')  

  // words.Pt.randomWord(beginningPart, middlePart, endPart)
  wordsPt.randomWord('ab', '*', '*') // 'abcesso'
  wordsPt.randomWord('a', 'e', '*') // 'abcesso' but not 'abade'
  wordsPt.randomWord('*', 's', '*') // 'espesso' but not 'sapato' nor 'mamas'
  wordsPt.randomWord('*', '*', 's') // 'mamas'
  wordsPt.randomWord('t', '*', 's') // 'tetas'
  wordsPt.randomWord('t', 'et', 'as') // 'tetanizarias'
  wordsPt.randomWord('se', 'o', 's') // 'seios'
  wordsPt.randomWord('sa', 'a', 'to') // 'salteamento'

  // exactly the same as randomWord, but gets all the words
  wordsPt.getArray() // array with all the words
  wordsPt.getArray('abc') // ['abcesso', 'abcessos', 'abcissa', 'abcissas']
  wordsPt.getArray('t', 'et', 'as') // ['tabuletas', 'tchetchenas', 'telefotometrias', 'telemetrias', ... ]
  wordsPt.getArray('tet', 'a', 's') // ['tetanizadas', 'tetanizados', 'tetanizais' , 'tetanizamos', ... ]

  words.Pt.biggestWord() // constitucionalizar-lhes-íamos
  // do something more
})

just the file

If you simply want for the plain file, wherein the words are separated by newlines \n, check the present file wordsList.zip. The corresponding unzipped file is encoded in iso-8859-1.

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago