twitter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 3 Imported by: 0

README

This package provides a jargon filter to identify Twitter-style hanshtags and handles, combining them into a single token.

By default, the jargon tokenizer sees @ and # as separate tokens. This filter looks for those tokens, followed by a token which meets Twitter's rules for legal handles and hashtags. The result of two such tokens is a single token, i.e.:

"@" + "somename" → "@somename" "#" + "sometag" → "#sometag"

Usage

tokens := jargon.Tokenize(reader)
twittered := tokens.Filter(twitter.Hashtags, twitter.Handles)

Documentation

Overview

Package twitter provides filters to identify Twitter-style @handles and #hashtags, and coalesce them into single tokens

Index

Constants

This section is empty.

Variables

View Source
var Handles = sigil.NewFilter("@", legalHandle)

Handles will identify Twitter-style handles, combining the @ and name into a single token

View Source
var Hashtags = sigil.NewFilter("#", legalHashtag)

Hashtags will identify Twitter-style hashtags, combining the # and tag into a single token

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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