Skip to content

Instantly share code, notes, and snippets.

View toVersus's full-sized avatar

Tsubasa Nagasawa toVersus

View GitHub Profile
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
@toVersus
toVersus / extract_origin.go
Created April 27, 2018 12:49
[Language Processing 100 Essentials] #72: Extract origins by removing the element matched with stop words
package main
import (
"bufio"
"flag"
"fmt"
"os"
"strings"
porterstemmer "github.com/reiver/go-porterstemmer"
@toVersus
toVersus / stop_words.go
Created April 26, 2018 14:13
[Language Processing 100 Essentials] #71: Check whether the lists of stop word contain the specified word
package main
import (
"flag"
"fmt"
"reflect"
)
var StopWords = []string{"i", "me", "my", "myself", "we", "our", "ours", "ourselves",
"you", "your", "yours", "yourself", "yourselves", "he", "him", "his", "himself",
@toVersus
toVersus / format_data.go
Created April 25, 2018 11:44
[Language Processing 100 Essentials] #70: Discriminate whether the text represents positive or negative sentiment or not
package main
import (
"bufio"
"fmt"
"math/rand"
"os"
"strings"
"time"
)
@toVersus
toVersus / result.html
Created April 24, 2018 11:48
[Language Processing 100 Essentials] #69: Create web application to search artist information
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@toVersus
toVersus / sort_by_rating.go
Created April 23, 2018 14:57
[Language Processing 100 Essentials] #68: Sort artist by rating count
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
mgo "gopkg.in/mgo.v2"
@toVersus
toVersus / retrieve_by_alias.go
Created April 22, 2018 11:12
[Language Processing 100 Essentials] #67: Retrieve artist information by alias
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
mgo "gopkg.in/mgo.v2"
@toVersus
toVersus / count_collection.go
Created April 21, 2018 14:26
[Language Processing 100 Essentials] #66: Count number of artists in Japan
package main
import (
"os"
"testing"
"github.com/go-test/deep"
mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)