olivia: github.com/olivia-ai/olivia/language Index | Files

package language

import "github.com/olivia-ai/olivia/language"

Index

Package Files

countries.go math.go movies.go names.go

func FindMathOperation Uses

func FindMathOperation(entry string) string

Find a math operation in a string an returns it

func FindMoviesGenres Uses

func FindMoviesGenres(content string) (output []string)

FindMoviesGenres returns an array of genres found in the entry string

func FindName Uses

func FindName(sentence string) string

FindName returns a name found in the given sentence or an empty string if no name has been found

func FindNumberOfDecimals Uses

func FindNumberOfDecimals(entry string) int

Find the number of decimals asked in the query

func SerializeNames Uses

func SerializeNames() (names []string)

type Country Uses

type Country struct {
    OfficialName string   `json:"official_name"`
    CommonName   string   `json:"common_name"`
    Capital      string   `json:"capital"`
    Region       string   `json:"continent"`
    SubRegion    string   `json:"subcontinent"`
    Code         string   `json:"code"`
    Borders      []string `json:"borders"`
    Area         float64  `json:"area"`
    Currency     string   `json:"currency"`
    Flag         string   `json:"flag"`
}

func FindCountry Uses

func FindCountry(sentence string) Country

FindCountry returns the country found in the sentence and if no country is found, returns an empty Country struct

func SerializeCountries Uses

func SerializeCountries() (countries []Country)

type Movie Uses

type Movie struct {
    Name   string
    Genres []string
    Rating float64
}

func SearchMovie Uses

func SearchMovie(genre, userToken string) (output Movie)

func SerializeMovies Uses

func SerializeMovies() (movies []Movie)

Package language imports 13 packages (graph) and is imported by 1 packages. Updated 2019-08-09. Refresh now. Tools for package owners.