abbrvt

package module
v0.0.0-...-db1d6f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2015 License: MIT Imports: 2 Imported by: 0

README

abbrvt

Abbreviates a word by removing vowels and a sentence by using its words' capital letters

To use this library, import as follows:

import "github.com/callmekatootie/abbrvt"

Examples

To abbreviate a word,

abbrvt.Get("Germany") // Grmny

A single word is abbreviated by removing all vowels from it.

To abbreviate a sentence,

abbrvt.Get("National Aeronautics and Space Administration") // NASA

A sentence (multiple words) is abbreviated by taking the first letter of each word, only if the letter is a capital letter. Any word which starts with a small letter is ignored.

Points to note

  • If a sentence does not contain any word that begins with a capital letter, you get an error
  • If a sentence has less than 3 words which begin with a capital letter, you get an error

Inspired / ported from this ruby gem - https://github.com/kachick/abb

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(original string) (string, error)

Public function that abbreviates the given string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL