npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@andsfonseca/palavras-pt-br

v1.0.8

Published

Uma biblioteca que informa todas as palavras a partir de um json.

Downloads

103

Readme

Palavras PT-br

Código criado com o intuito de ajudar a ter uma lista de todas as palavras em português brasileiro

O que é?

Um pacote com uma listagem de palavras em português brasileiro

Instalação

Instale o pacote globalmente através do repositório npmjs.com.

npm i @andsfonseca/palavras-pt-br

Uso

Importação

Para realizar a importação via Javascript

var Word = require('@andsfonseca/palavras-pt-br').Word;

Para realizar a importação via Typescript

import { Word } from '@andsfonseca/palavras-pt-br'

Funções

  • getAllWords (limit: number = 0, removeAccents: boolean = true, includeCompounds: boolean = true, includeSpecialCharacters: boolean = false, includeProperNouns: boolean = false)

Método que retorna um array de palavras da base com a filtragem escolhida pelo usuário.

| Argumento | Descrição | Obrigatório | |:------------------------:|:--------------------------------------------------------------------------------------:|:-------------------:| | limit | Limite de caracteres da palavra, caso seja menor ou igual a 0 serão considerada todas. | Não, padrão 0 | | removeAccents | Informa se deve remover os acentos nas palavras. | Não, padrão false | | includeCompounds | Informa se deve incluir palavras compostas. | Não, padrão true | | includeSpecialCharacters | Informa se deve incluir palavras com caracateres especiais. | Não, padrão false | | includeProperNouns | Informa se deve incluir nomes próprios. | Não, padrão false |

let words: string[] = Word.getAllWords()
  • getRandomWord (limit: number = 0, removeAccents: boolean = true, includeCompounds: boolean = true, includeSpecialCharacters: boolean = false, includeProperNouns: boolean = false)

Método que retorna uma palavra aleatória da base com a filtragem escolhida pelo usuário.

Os argumentos são descritos no método getAllWords

let randomWord: string = Word.getRandomWord()
  • getDailyWord (limit: number = 0, removeAccents: boolean = true, includeCompounds: boolean = true, includeSpecialCharacters: boolean = false, includeProperNouns: boolean = false)

Método que retorna uma palavra aleatória por dia da base com a filtragem escolhida pelo usuário.

Os argumentos são descritos no método getAllWords

let randomWord: string = Word.getDailyWord()
  • checkValid (word: string, limit: number = 0, removeAccents: boolean = true, includeCompounds: boolean = true, includeSpecialCharacters: boolean = false, includeProperNouns: boolean = false)

Método que verifica se uma palavra está na base, com a filtragem escolhida pelo usuário.

| Argumento | Descrição | Obrigatório | |:------------------------:|:-------------------------:|:-------------------:| | word | Palavra a ser verificada. | ✅ Sim |

O restante dos argumentos são descritos no método getAllWords

let valid: boolean = Word.checkValid("teste")
  • wordleValidator(trueWord: string, triedWord: string)

Método que verifica a proximidade entre duas palavras, no estilo Wordle. Retorna informações sobre a validação da palavra

| Argumento | Descrição | Obrigatório | |:------------------------:|:-------------------------:|:-------------------:| | trueWord | Palavra verdadeira. | ✅ Sim | | triedWord | Palavra a ser verificada. | ✅ Sim |

let validation: IWordleValidation[] = Word.wordleValidator("tesla", "testu")

A interface IWordleValidation é descrita nesta seção

Interfaces

  • IWordleValidation

Representação da Validação do Wordle

interface IWordleValidation {
    word: string,
    contains: boolean,
    exact: boolean
}

| Propriedade | Descrição | |:--------------------:|:-------------------------:| | word | Letra. | | contains | Se a letra está na palavra. | | exact | Se a letra está na posição correta. |

Base de Dados

Bases Padrões

As bases de dados usados nesta biblioteca são:

| Dicionário | |:--------------------:| | Dicionário br.ispell | | pythonprobr | | @un-versed Termoo v2 |

Podem ser importadas da seguinte maneira

import { BRISPELL, PYTHONPROBR, UNVERSEDV2 } from '@andsfonseca/palavras-pt-br'

Por padrão a biblioteca @un-versed Termoo v2 é usada.

Você pode customizar a biblioteca da seguinte maneira:

Word.library = PYTHONPROBR
//Word.library = ["Outras", "Palavras", "Da", "Sua", "Base"]

Issues

Sinta-se livre para contribuir com o projeto.

Contribuições

  1. Crie uma cópia do projeto (fork)
  2. Crie uma branch com sua modificação (git checkout -b my-new-resource)
  3. Faça um commit commit (git commit -am 'Adding a new resource...')
  4. Push (git push origin my-new-resource)
  5. Crie uma Pull Request