Coder Social home page Coder Social logo

txtproc's Introduction

Text Processor

Build Status codecov Go Report Card

This is Go module for processing text. Currently only support word splitter.

Usage

https://godoc.org/github.com/yusufsyaifudin/txtproc

go get -v github.com/yusufsyaifudin/txtproc

Then use import module ysf/txtproc in import path.

Example:

package main

import (
    "context"
    "fmt"
    "log"
    "ysf/txtproc"
)

func main() {
    text := "This is a words collection."
    words, err := txtproc.WordSeparator(context.Background(), text)

    if err != nil {
        log.Fatal(err.Error())
        return
     }

    for _, word := range words {
        fmt.Println(word.GetOriginalText())
    }
}

it should print:

This

is

a

words

collection.

Benchmark

Benchmark on Macbook Pro 16GB, Quad-Core Intel Core i5 2.4Ghz

go test -bench=.

goos: darwin
goarch: amd64
pkg: ysf/txtproc
BenchmarkWordSeparator_1Word-8           2270744               531 ns/op
BenchmarkWordSeparator_100Words-8          18622             62381 ns/op
BenchmarkWordSeparator_200Words-8           9567            125014 ns/op
PASS
ok      ysf/txtproc     5.811s

Work In Progress

  • Word Splitter (split by space, tab, new line)
  • Word Replacer (replace word with DIY Replacer function)
  • Profanity Filter
  • Testing/Mock implementation of interface
  • word-level n-grams, for example if text written as a s u it will not be detected, but using n-gram, we can detect it using the version a s u, as u, a su and asu
  • Leet speak

txtproc's People

Contributors

yusufsyaifudin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.