Options
All
  • Public
  • Public/Protected
  • All
Menu

Doggo-Translator-TS

Travis (.com) Codecov GitHub language count GitHub commit activity GitHub contributors styled with prettier Donate

A TypeScript library for translating words to 'Doggo' speak!

Usage

You can use the library defaults by creating an instance of the DoggoTranslator class, and using it's publicly available methods. Read More

Optionally you can pass in a DoggoTranslatorConfig object to configure the instance when created.

Basic Use Case

const library = require('../dist/doggo-translator-ts.umd');
const DoggoTranslator = library.DoggoTranslator;

const myTranslator = new DoggoTranslator();
console.warn(myTranslator.translateSentence('Testing this, bark!'))
console.warn(myTranslator.translateSentence('Hello friend! I hope you have a great day!'))

User Defined Translations

const library = require('../dist/doggo-translator-ts.umd');
const DoggoTranslator = library.DoggoTranslator;
const myTranslations ={
  words: {
    hey: 'hi',
    friend: 'frenn',
    run: 'floop'
  },
  suffixes: {
    ing: 'in'
  }
}

const myTranslator = new DoggoTranslator({ userDefinedTranslations: myTranslations });
const text = 'Hey Friend! Do you want to go run around? I love running!';
const translated = myTranslator.translateSentence(text)
console.warn(translated); // Hi frenn! Do you want to go floop around? I love runnin.

Browser

To use in Browser, check out the this example

Node

To use in Node, check out the this example

Features

User Supplied Translation Definitions

You can pass a TranslationMapInterface compliant object to the DoggoTranslatorConfig when instantiating to supply new translations on the fly.

Word Swaps

Entire words can be swapped, as expected.

Suffix Swaps

Optionally you can supply 'suffixes' to be swapped at the end of words.

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import myLib from 'mylib'

Additionally, you can import the transpiled modules from dist/lib in case you have a modular library:

import something from 'mylib/dist/lib/something'

Public API

TypeDoc Documentation

translateSentence

getAllLanguageTokens

setLanguage

License

This application is released under the MIT license.

Inspired By

DoggoTranslator (core) :dog:

Index

Object literals

Const EN_TRANSLATIONS

EN_TRANSLATIONS: object

suffixes

suffixes: object = EN_TRANSLATION_SUFFIXES

Type declaration

  • [key: string]: string

words

words: object = EN_TRANSLATION_WORDS

Type declaration

  • [key: string]: string

Const EN_TRANSLATION_SUFFIXES

EN_TRANSLATION_SUFFIXES: object

ing

ing: string = "in"

Const EN_TRANSLATION_WORDS

EN_TRANSLATION_WORDS: object

bar

bar: string = "bork"

barkin

barkin: string = "borking"

beave

beave: string = "bevver"

beaver

beaver: string = "bevvers"

big doggo

big doggo: string = "woofer"

big doggos

big doggos: string = "woofers"

big ol doggo

big ol doggo: string = "woofer"

big ol doggos

big ol doggos: string = "woofers"

bo

bo: string = "boye"

boy

boy: string = "boyes"

corg

corg: string = "corgo"

corgi

corgi: string = "corgos"

do

do: string = "doggo"

dog

dog: string = "doggos"

dogg

dogg: string = "doggo"

doggie

doggie: string = "doggos"

fac

fac: string = "snoot"

frien

frien: string = "fren"

giv

giv: string = "gib"

goo

goo: string = "gud"

hav

hav: string = "hav"

hel

hel: string = "heck"

hi

hi: string = "hims"

hik

hik: string = "hik"

huma

huma: string = "hooman"

lic

lic: string = "mlem"

lick

lick: string = "mlems"

licke

licke: string = "mlemmed"

lickin

lickin: string = "mlemming"

lov

lov: string = "luv"

nam

nam: string = "naym"

neve

neve: string = "nvr"

pu

pu: string = "puggo"

pug

pug: string = "puggos"

pupp

pupp: string = "pupper"

puppie

puppie: string = "puppers"

samoye

samoye: string = "cloud boye"

samoyed

samoyed: string = "cloud boyes"

sea

sea: string = "waterdoggo"

seal

seal: string = "waterdoggos"

shib

shib: string = "shibe"

shiba

shiba: string = "shibes"

smal

smal: string = "smol"

smol doggo

smol doggo: string = "pupper"

smol doggos

smol doggos: string = "puppers"

smol pug

smol pug: string = "puggorino"

smol pugs

smol pugs: string = "puggorinos"

smol pupper

smol pupper: string = "pupperino"

smol puppers

smol puppers: string = "pupperinos"

smol woofer

smol woofer: string = "doggo"

smol woofers

smol woofers: string = "doggos"

touch

touch: string = "boop"

touching

touching: string = "boopin"

whe

whe: string = "wen"

wit

wit: string = "wit"

you are frightening me

you are frightening me: string = "you are doing me a frighten"

you are scaring me

you are scaring me: string = "you are doing me a scare"

you are startling me

you are startling me: string = "you are doing me a startle"

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc