Skip to content

Instantly share code, notes, and snippets.

View judsonbsilva's full-sized avatar

Judson Silva judsonbsilva

  • Teresina - PI
View GitHub Profile
@judsonbsilva
judsonbsilva / nlpjs.js
Created August 13, 2017 16:05
Testing methods to data mining in big texts
const text = "4.1. EDITAL - CORREGEDORIA GERAL DA JUSTIÇA\nAVISO DE INTIMAÇÃO (Corregedoria Geral da Justiça de TERESINA)\nProcesso nº 0001107-87.2014.8.18.0139\nClasse: Reclamação Disciplinar\nRequerente: IGREJA ASSEMBLEIA DE DEUS DO DIRCEU DOIS\nAdvogado(s):\nRequerido: JOSÉ RAMOS DIAS FILHO, JUIZ DE DIREITO DA 2ª VARA CÍVEL DA COMARCA DE TERESINA-PI\nAdvogado(s): MOISÉS ÂNGELO DE MOURA REIS (OAB/PI Nº 874/75)\nDECISÃO: Em face do exposto,determino o arquivamento do presente expediente. Comunique-se à Corregedoria Nacional de Justiça, no prazo\nde quinze dias,sobre a presente decisão. Intimações necessárias. Teresina-PI, 19 de junho de 2017. Des. Brandão de Carvalho, Decano.\n5. FERMOJUPI/SECOF";
class NLPJS {
static regex = {
numericTitle: /^(\d+\.)+\s[A-Z]+/
}
static _cleanText(text){
return text.replace(/\s{2,}/, ' ');
@judsonbsilva
judsonbsilva / testing.js
Last active July 18, 2017 00:00
An NLP test in JS
const textao = `
SECRETARIA DE POLÍTICAS DE PROMOÇÃO
DA IGUALDADE RACIAL
DECRETOS DE 1o
- DE JANEIRO DE 2015
A PRESIDENTA DA REPÚBLICA, no uso da atribuição
que lhe confere o art. 84, caput, inciso I, da Constituição, resolve
EXONERAR
LUIZA HELENA DE BAIRROS do cargo de Ministra de Estado
Chefe da Secretaria de Políticas de Promoção da Igualdade Racial da
@judsonbsilva
judsonbsilva / graph.js
Last active October 6, 2016 01:51
A Graph representation with JavaScript ES6
class Graph {
constructor(){
this.nodes = [];
this.edges = [];
}
addNode( node ){
if( !this.hasNode(node) )
this.nodes.push(node);
# Install Mysql
sudo apt-get install mysql-server
sudo mysql_secure_installation
sudo mysql_install_db
# Add PHP lastest versions repository
sudo add-apt-repository ppa:ondrej/php
# Update packages ppa
sudo apt-get update
#!/bin/bash
# codecs-raring.sh
# Criado: Sab 27/abr/2013 hs 16h
# Last Change: Sab 27/abr/2013 hs 16h
# autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
# twitter: http://www.twitter.com/voyeg3r
# email: <voyeg3r  gmail.com>
# baseado nos scripts https://gist.github.com/voyeg3r/3921102
# https://gist.github.com/1285188
@judsonbsilva
judsonbsilva / gist:d2d88397fbac375af890
Created June 11, 2014 23:29
Download youtube video
decodeURIComponent(ytplayer.config.args['url_encoded_fmt_stream_map']).split(',').map(function(url){return [url.replace(/.+https/,'https'),url.replace(/.+\?/,'').split('&').pop().split(';').shift()];}).filter(function(link,i){ return (/^https/).test(link[0]) ? link: null; });
@judsonbsilva
judsonbsilva / configure-ubuntu.sh
Last active June 21, 2023 18:40
Cansei de ficar procurando comando na internet ! Tá aê pra configurar algumas coisas no ubuntu
installEssentials(){
sudo apt-get update && sudo apt-get --force-yes install curl python-software-properties python g++ make build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip arj cabextract file-roller mpack p7zip p7zip-full p7zip-rar rar sharutils unace unace-nonfree unrar unzip uudeview zip preload youtube-dl && youtube-dl -U
} && installEssentials
installGit(){
sudo apt-get update && sudo apt-get --force-yes install git
} && installGit
installNode(){
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@judsonbsilva
judsonbsilva / hyphenizator.rb
Created September 20, 2012 15:50
Pega um arquivo de texto troca vogais por '-' e salva em outro arquivo de texto
#Processo recebe o local do arquivo, e onde será salvo o novo arquivo
hyphen = proc { |from, to|
#Cria um novo arquivo de texto
text = File.new( to ,'w')
#Salva no novo arquivo de texto o conteúdo do (arquivo com as vogais) alterado pela Regexp
text.puts File.read( from ).gsub(/[aeiou]/i,"-")
#Fecha o arquivo
text.close
}
#Chama o processo passando os argumentos pelo terminal