git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
package main | |
import ( | |
"log" | |
"time" | |
"golang.org/x/net/context" | |
"google.golang.org/grpc" | |
pb "github.com/jzelinskie/grpc/simple" |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
package main | |
import ( | |
"bufio" | |
"encoding/csv" | |
"encoding/json" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" |
A running example of the code from:
Small refactorings made to original code:
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-a_.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-aa.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ab.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ac.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ad.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ae.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-af.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ag.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ah.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ai.gz |
#!/bin/bash | |
cat lista.txt | while read -r file; do wget "$file" && gzip -dc "${file##*/}" | \ | |
tr '[:upper:]' '[:lower:]' | sed \ | |
-e 's/\(_\?noun_\?\)\|\(_\?adp_\?\)\|\(_\?adv_\?\)\|\(_\?det_\?\)\|\(_\?verb_\?\)\|\(_\?adj_\?\)\|\(_\?end_\?\)\|\(_\?conj_\?\)\|\(S\?_\?pron_\?\)\|\(_\?num_\?\)/ /g' \ | |
-e "s/\([^a-zàéèìòù '.]\)/ /g" \ | |
-e "s/\s\{2,\}/ /g" \ | |
-e "s/\.\{2,\}/./g" \ | |
-e "s/[^a-zàéèìòù.]\{1,\}\.\{1,\}//g" \ | |
-e "s/\s\{2,\}/ /g" \ |