Exemple #1
0
// NewTileFetcher creates a new Tilefetcher struct
func NewTileFetcher(tileProvider *TileProvider) *TileFetcher {
	t := new(TileFetcher)
	t.tileProvider = tileProvider
	app := appdirs.New("go-staticmaps", "flopp.net", "0.1")
	t.cacheDir = fmt.Sprintf("%s/%s", app.UserCache(), tileProvider.Name)
	t.useCaching = true
	return t
}
Exemple #2
0
	"archive/tar"
	"bufio"
	"bytes"
	"compress/gzip"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"net/mail"
	"os"
	"path"

	"github.com/Wessie/appdirs"
)

var app = appdirs.New("enroncorpus", "chimeracoder", ".1")

const _CorpusFilename = "enron_mail_20110402.tgz"
const _CorpusUrl = "http://www.cs.cmu.edu/%7E./enron/enron_mail_20110402.tgz"

// TODO make this satisfy the textcorpora interface

type EnronCorpus struct {
	EmailsCursor chan Email
}

func NewCorpus() (*EnronCorpus, error) {

	filename := path.Join(app.UserData(), _CorpusFilename)
	// Check if file already exists
	if _, err := os.Stat(filename); err != nil {
Exemple #3
0
import (
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"path"
	"regexp"
	"strings"
	"unicode"

	"github.com/ChimeraCoder/textcorpora"
	"github.com/Wessie/appdirs"
)

var app = appdirs.New("cmudict", "chimeracoder", ".1")

type cmuCorpus map[string][]string

var cmuCorpusCached cmuCorpus = map[string][]string{}

const _CorpusFilename = "cmudict.0.7a.corpus"
const _CorpusUrl = "http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict.0.7a"

// CMUCorpus returns the CMU corpus
func CMUCorpus() (textcorpora.Corpus, error) {

	filename := path.Join(app.UserData(), _CorpusFilename)
	// Check if file already exists
	if _, err := os.Stat(filename); err != nil {