wolfram

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2015 License: BSD-2-Clause Imports: 5 Imported by: 2

README

go-wolfram-alpha

Abstract

Api for wolfram alpha & will be implement qualified for mathematica. You get raw, simple structure binding for wolfram alpha QueryResult

Install

go get github.com/KeizoBookman/go-wolfram-alpha

SAMPLE

under _exmaple

On your terminal.

go build ./_example/sample.go
./example/sample

and other sample

PLAN

implementation for all wolfram alpha api

users can switch plaintext/image/mathematica(minput) input and other structure that wolfram Research provides.

LICENSE

2 clause BSD

Documentation

Index

Constants

View Source
const (
	//prime number
	A_PLAIN  int = 2
	A_IMAGE  int = 3
	A_SOUND  int = 5
	A_HTML   int = 7
	A_CELL   int = 11
	A_MINPUT int = 13

	A_PI int = A_PLAIN * A_IMAGE
	A_PS int = A_PLAIN * A_SOUND
	A_PH int = A_PLAIN * A_HTML
	A_PC int = A_PLAIN * A_CELL
	A_PM int = A_PLAIN * A_MINPUT

	A_IS int = A_IMAGE * A_SOUND
	A_IH int = A_IMAGE * A_SOUND
	A_IC int = A_IMAGE * A_SOUND
	A_IM int = A_IMAGE * A_SOUND

	A_SH int = A_SOUND * A_HTML
	A_SC int = A_SOUND * A_CELL
	A_SM int = A_SOUND * A_MINPUT

	A_HC int = A_HTML * A_CELL
	A_HM int = A_HTML * A_MINPUT

	A_PIS int = A_PLAIN * A_IMAGE * A_SOUND
	A_PIH int = A_PLAIN * A_IMAGE * A_HTML
	A_PIC int = A_PLAIN * A_IMAGE * A_CELL
	A_PIM int = A_PLAIN * A_IMAGE * A_MINPUT
	A_PSH int = A_PLAIN * A_SOUND * A_HTML
	A_PSC int = A_PLAIN * A_SOUND * A_CELL
	A_PSM int = A_PLAIN * A_SOUND * A_MINPUT
	A_PHC int = A_PLAIN * A_HTML * A_CELL
	A_PHM int = A_PLAIN * A_HTML * A_MINPUT
	A_ISH int = A_IMAGE * A_SOUND * A_HTML
	A_ISC int = A_IMAGE * A_SOUND * A_CELL
	A_ISM int = A_IMAGE * A_SOUND * A_MINPUT
	A_IHC int = A_IMAGE * A_HTML * A_CELL
	A_IHM int = A_IMAGE * A_HTML * A_MINPUT
	A_ICM int = A_IMAGE * A_CELL * A_MINPUT
	A_SHC int = A_SOUND * A_HTML * A_CELL
	A_SHM int = A_SOUND * A_HTML * A_MINPUT
	A_SCM int = A_SOUND * A_CELL * A_MINPUT
	A_ALL int = A_PLAIN * A_IMAGE * A_SOUND * A_HTML * A_CELL * A_MINPUT
)

flag

Variables

This section is empty.

Functions

This section is empty.

Types

type Assumption

type Assumption struct {
	Type     string  `xml:"type,attr"`
	Word     string  `xml:"word,attr"`
	Template string  `xml:"template,attr"`
	Count    int32   `xml:"count,attr"`
	Values   []Value `xml:"value"`
}

type Assumptions

type Assumptions struct {
	XMLName xml.Name `xml:"assumptions"`

	Assum []Assumption `xml:"assumption"`
	// contains filtered or unexported fields
}

type Client

type Client struct {
	Query QueryResult
	// contains filtered or unexported fields
}

func New

func New(id string) *Client

func (*Client) Get

func (c *Client) Get(data string, formatFlag int) (*QueryResult, error)

func (*Client) IsSuccessed

func (c *Client) IsSuccessed() bool

func (*Client) ShowClient

func (c *Client) ShowClient() error

type ExamplePage

type ExamplePage struct {
	Category string `xml:"category,attr"`
	Url      string `xml:"url,attr"`
}

type Img

type Img struct {
	XMLName xml.Name `xml:"img"`
	Src     string   `xml:"src"`
	Alt     string   `xml:"alt"`
	Title   string   `xml:"title"`
	Width   string   `xml:"width"`
	// contains filtered or unexported fields
}

type Pod

type Pod struct {
	XMLName xml.Name `xml:"pod"`
	//tag
	Title      string `xml:"title,attr"`
	Scanner    string `xml:"scanner,attr"`
	Id         string `xml:"id,attr"`
	Position   string `xml:"position,attr"`
	Err        string `xml:"error,attr"`
	Numsubpods int32  `xml:"numsubpods,attr"`

	Subpods []SubPod `xml:"subod"`
}

type QueryResult

type QueryResult struct {

	//
	//
	XMLName       xml.Name `xml:"queryresult"`
	Error         bool     `xml:"error,attr"`
	Numpods       int32    `xml:"numpods,attr"`
	Datatypes     string   `xml:"datatypes,attr"`
	Timedout      string   `xml:"timedout,attr"`
	Timedoutpods  string   `xml:"timedoutpods,attr"`
	Timing        int32    `xml:"timing,attr"`
	Parsetiming   int32    `xml:"parsetiming,attr"`
	Parsetimedout bool     `xml:"parsetimedout,attr"`
	Recalculate   string   `xml:"recalculate,attr"`
	Id            string   `xml:"id,attr"`
	Host          string   `xml:"host,attr"`
	Server        int32    `xml:"server,attr"`
	Related       string   `xml:"related,attr"`
	Version       string   `xml:"version,attr"`

	Pods        []Pod         `xml:"pod"`
	Assumpt     []Assumptions `xml:"assumptions"`
	Sources     Sources       `xml:"sources"`
	ExamplePage ExamplePage   `xml:"examplepage"`
	Scripts     string        `xml:"scripts"`
	Css         string        `xml;"css"`
	// contains filtered or unexported fields
}

type Source

type Source struct {
	XMLName xml.Name `xml:"source"`
	Url     string   `xml:"url,attr"`
	Text    string   `xml:"text,attr"`
}

type Sources

type Sources struct {
	XMLName xml.Name `xml:"sources"`
	Source  []Source `xml:"source"`
	Count   int32    `xml:"count,attr"`
}

type State

type State struct {
	XMLName xml.Name `xml:"state"`
	Name    string   `xml:"name"`
	Input   string   `xml:"input"`
}

type States

type States struct {
	XMLName xml.Name `xml:"states"`
	Count   int32    `xml:"count"`
	State   []State  `xml:"state"`
}

type SubPod

type SubPod struct {
	XMLName   xml.Name `xml:"subpod,attr"`
	Title     string   `xml:"title,attr"`
	PlainText string   `xml:"plaintext"`
	Image     Img      `xml:"img"`
}

type Value

type Value struct {
	XMLName xml.Name `xml:"value"`
	Name    string   `xml:"name,attr"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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