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
# This gist is initially used for analysing data in Spanish | |
import unidecode | |
import csv | |
def remove_accent (feed): | |
csv_f = open(feed, encoding='latin-1', mode='r') | |
csv_str = csv_f.read() | |
csv_str_removed_accent = unidecode.unidecode(csv_str) | |
csv_f.close() |
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
import re | |
import json | |
import pickle | |
def to_decimal (loc): | |
if type(loc) != str: | |
loc = str(loc) | |
if re.match('.*deg.*', loc): | |
loc_list = re.split('[-deg\''']+', loc) | |
if loc_list[0] == '': |
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
#!/bin/bash | |
echo “Recording… Press Ctrl+C to Stop.” | |
arecord -D “plughw:1,0” -q -f cd -t wav | ffmpeg -loglevel panic -y -i – -ar 16000 -acodec flac file.flac > /dev/null 2>&1 | |
echo “Processing…” | |
wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d -f12 >stt.txt | |
echo -n “You Said: ” | |
cat stt.txt |
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
import json | |
import os | |
import sys | |
import googlemaps | |
from keys import google_map_key | |
# google map credential | |
gmaps = googlemaps.Client(key=google_map_key) | |
def convert (feed): |