nounphrases

package module
v0.0.0-...-57479f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 5 Imported by: 0

README

nounphrases

Introduction

nounphrases allows us a to find noun phrases on a given text. It splits the input text in several sentences and then processes every sentence, extracting the list of noun phrases encountered on them.

The algorithm is port of the noun phrases extractor from the TextBlob Python's library, which uses POS tagging.

Usage

The Find(string) function will return an array of phrases found on the given text.

package main

import (
    "fmt"
    "github.com/eroatta/nounphrases"
    "log"
)

func main() {
    phrases, err := nounphrases.Find("We have red cars and yellow trucks")
    if err != nil {
        log.Fatal(err)
    }

    for i, phr := range phrases {
        fmt.Println(fmt.Sprintf("Phrase #%d: %s", i, phr))
    }
}

License

See the LICENSE file for license rights and limitations (MIT).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(text string) ([]string, error)

Find looks for phrases on the text body.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL