Skip to content

Instantly share code, notes, and snippets.

View brunovcosta's full-sized avatar

Bruno Vieira Costa brunovcosta

View GitHub Profile
@erickrf
erickrf / tokenizer.py
Last active March 5, 2023 05:12
Portuguese tokenizer
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from nltk.tokenize import RegexpTokenizer
import argparse
import os
"""
Script for tokenizing Portuguese text according to the Universal Dependencies
(UD) tokenization standards. This script was not created by the UD team; it was
@gaearon
gaearon / slim-redux.js
Last active December 3, 2024 06:34
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {