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
from googletrans import Translator | |
def translate(sentence: str, speaker: str, dest: str): | |
sentence = ("he" if speaker == "M" else "she") + " said: " + sentence # Preprocess = Add prefix | |
out = Translator().translate(sentence, dest=dest).text # Translate with prefix | |
return ":".join(out.split(":")[1:]) # Postprocess = Remove prefix | |
print(translate("I love you", speaker="M", dest="he")) # Hebrew: אני אוהב אותך | |
print(translate("I love you", speaker="F", dest="he")) # Hebrew: אני אוהבת אותך |
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
const path = require('path'); | |
module.exports = function (config) { | |
config.set({ | |
frameworks: ['jasmine'], | |
files: [ | |
{pattern: 'src/**/*.spec.js', watched: true} | |
], |
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 { IonicPage, ModalController, ToastController } from 'ionic-angular'; | |
import { Component } from '@angular/core'; | |
import { Media, MediaObject } from '@ionic-native/media'; | |
import { File } from '@ionic-native/file'; | |
import { UserProvider } from '../../providers/user/user'; | |
@IonicPage({ segment: 'index' }) | |
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' |
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 { Injectable } from '@angular/core'; | |
import { AngularFireDatabase } from 'angularfire2/database'; | |
import GeoFire from 'geofire'; | |
import { Coordinates } from '../../models/coordinates'; | |
import { Observable } from 'rxjs/Observable'; | |
import Rx from 'rxjs/Rx'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
export interface GeoFireLocation { | |
key: string; |