All Projects → gernest → Mention

gernest / Mention

Licence: mit
Twitter like mentions and #hashtags parser for Go(Golang)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Mention

Java
jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
Stars: ✭ 1,308 (+1221.21%)
Mutual labels:  parser
Argumentum
C++ command line parsing library
Stars: ✭ 92 (-7.07%)
Mutual labels:  parser
Nessus map
Parse .nessus file(s) and shows output in interactive UI
Stars: ✭ 97 (-2.02%)
Mutual labels:  parser
Postcss Less
PostCSS Syntax for parsing LESS
Stars: ✭ 93 (-6.06%)
Mutual labels:  parser
Kafka Connect Twitter
Kafka Connect connector to stream data in real time from Twitter.
Stars: ✭ 94 (-5.05%)
Mutual labels:  twitter
Duckling old
Deprecated in favor of https://github.com/facebook/duckling
Stars: ✭ 1,332 (+1245.45%)
Mutual labels:  parser
Libdparse
Library for lexing and parsing D source code
Stars: ✭ 91 (-8.08%)
Mutual labels:  parser
Oreilly reactive python for data
Resources for the O'Reilly online video "Reactive Python for Data"
Stars: ✭ 98 (-1.01%)
Mutual labels:  twitter
Socialauthhelper
Easy social network authorization for Android. Supports Facebook, Twitter, Instagram, Google+, Vkontakte. Made by Stfalcon
Stars: ✭ 94 (-5.05%)
Mutual labels:  twitter
Elm Markdown
Pure Elm markdown parsing and rendering
Stars: ✭ 96 (-3.03%)
Mutual labels:  parser
Fbp
FBP flow definition language parser
Stars: ✭ 93 (-6.06%)
Mutual labels:  parser
Swurg
Parse OpenAPI documents into Burp Suite for automating OpenAPI-based APIs security assessments (approved by PortSwigger for inclusion in their official BApp Store).
Stars: ✭ 94 (-5.05%)
Mutual labels:  parser
Graphql Go Tools
Tools to write high performance GraphQL applications using Go/Golang.
Stars: ✭ 96 (-3.03%)
Mutual labels:  parser
Tree Sitter Python
Python grammar for tree-sitter
Stars: ✭ 92 (-7.07%)
Mutual labels:  parser
Regexpp
The regular expression parser for ECMAScript.
Stars: ✭ 97 (-2.02%)
Mutual labels:  parser
Social Links
Simple library to count shares and generate share buttons
Stars: ✭ 91 (-8.08%)
Mutual labels:  twitter
Tweetable Polyglot Png
Pack up to 3MB of data into a tweetable PNG polyglot file.
Stars: ✭ 299 (+202.02%)
Mutual labels:  twitter
Sarcasmdetection
Sarcasm detection on tweets using neural network
Stars: ✭ 99 (+0%)
Mutual labels:  twitter
Tia
Your Advanced Twitter stalking tool
Stars: ✭ 98 (-1.01%)
Mutual labels:  twitter
Laravel Oh Generators
This package extends the core file generators that are included with Laravel 5 or later.
Stars: ✭ 96 (-3.03%)
Mutual labels:  parser

mention Build Status Coverage Status GoDoc

mention parses twitter like mentions and hashtags like @gernest and #Tanzania from text input.

Installation

go get github.com/gernest/mention

Usage

mention is flexible, meaning it is not only limited to @ and # tags. You can choose whatever tag you like and mention will take it from there.

twitter like mentions

For instance you have the following message

hello @gernesti I would like to follow you on twitter

And you want to know who was mentioned in the text.

package main

import (
	"fmt"
	"strings"

	"github.com/gernest/mention"
)

func main() {
	message := "hello @gernest I would like to follow you on twitter"

	tags := mention.GetTags('@', message)
	tagStrings := mention.GetTagsAsUniqueStrings('@', message)

	fmt.Println(tags)
	fmt.Println(tagStrings)
}

If you run the above example it will print [gernest] is the stdout.

twitter like hashtags

For instance you have the following message

how does it feel to be rejected? #loner

And you want to know the hashtags

package main

import (
	"fmt"
	"strings"

	"github.com/gernest/mention"
)

func main() {
	message := "how does it feel to be rejected? #loner"

	tags := mention.GetTags('#', message)

	fmt.Println(tags)
}

If you run the above example it will print [loner] in the stdout.

The API

mention exposes only one function GetTags(char rune, src string) []string

The first argument char is the prefix for your tag, this can be @ or # or whatever unicode character you prefer. Don't be worried by its type rune it is just your normal characters but in single quotes. See the examples for more information.

The second argument is the source of the input which can be from texts.

Contributing

Start with clicking the star button to make the author and his neighbors happy. Then fork the repository and submit a pull request for whatever change you want to be added to this project.

If you have any questions, just open an issue.

Author

Geofrey Ernest Twitter : @gernesti

Chad Barraford Github : @cbarraford

Licence

This project is released under the MIT licence. See LICENCE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].