Created
October 15, 2020 16:53
-
-
Save pressure679/4b8246cb506e96f371e0725c64c97ad7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
// "bufio" | |
"io/ioutil" | |
"flag" | |
"github.com/pressure679/rake" | |
"math" | |
) | |
func main() { | |
fileflag := flag.String("file", "", "file to read from") | |
flag.Parse() | |
osfile, err := os.Open(*fileflag) | |
if err != nil { panic(err) } | |
data, err := ioutil.ReadAll(osfile) | |
raked := rake.RunRake(string(data)) | |
err = osfile.Close() | |
if err != nil { panic(err) } | |
for key, _ := range raked { | |
// fmt.Printf(".%2f - %s\n", raked[key].Value, raked[key].Key) | |
fmt.Println(fmt.Sprintf("%.2f", math.Round(raked[key].Value*100)/100), "-", raked[key].Key) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment