Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor using Keyword and Emoji #11

Open
pietroppeter opened this issue Nov 28, 2020 · 0 comments
Open

refactor using Keyword and Emoji #11

pietroppeter opened this issue Nov 28, 2020 · 0 comments

Comments

@pietroppeter
Copy link
Owner

type
  Keyword = distinct string # e.g "grinning"
  Emoji = distinct string # e.g "😀" 

I think this could be very useful, in particular to add a match functionality that could be used to refactor emojize and will give an easy implementation of #4 (and possibly also #7).

type
  Captures[T] = seq[tuple[index: Natural, pattern: T]]

func match(text: string): Captures[Keyword]
func match(text: string): Captures[Emoji]

Also one could support an Emoji by UniqueKeyword (list of UniqueKeywords generated when parsing emoji data) and Emojis by Keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant