Home

Awesome

Logo

Cadmium is a Natural Language Processing (NLP) library for Crystal.

For full API documentation check out the docs.

For more complete and up to date information about specific parts of Cadmium, check out each relevant shard repository.

Shard nameDescription
cadmium_tokenizerContains several types of string tokenizers
cadmium_stemmerContains a Porter stemmer, useful to get the stems of english words
cadmium_ngramsContains methods to obtain unigram, bigrams, trigrams or ngrams from strings
cadmium_classifierContains two probabilistic classifiers used in NLP operations like language detection or POS tagging for example
cadmium_readabilityAnalyzes blocks of text and determine, using various algorithms, the readability of the text.
cadmium_tfidfCalculates the Term Frequency–Inverse Document Frequency of a corpus
cadmium_glovePure Crystal implementation of Global Vectors for Word Representations
cadmium_pos_taggerTags each token of a text with its Part Of Speech category
cadmium_lemmatizerReturns the lemma of each given string token
cadmium_summarizerExtracts the most meaningful sentences of a text to create a summary
cadmium_sentimentEvaluates the sentiment of a text
cadmium_distanceProvides two string distance algorithms
cadmium_transliteratorProvides the ability to transliterate UTF-8 strings into pure ASCII so that they can be safely displayed in URL slugs or file names.
cadmium_phoneticsAllows to match a string with its sound representation
cadmium_inflectorAllows to inflect english words (nouns, verbs and numbers)
cadmium_graphEdgeWeightedDigraph represents a digraph, you can add an edge, get the number vertexes, edges, get all edges and use toString to print the Digraph.
cadmium_trieA trie is a data structure for efficiently storing and retrieving strings with identical prefixes, like "meet" and "meek".
cadmium_wordnetPure crystal implementation of Stanford NLPs WordNet
cadmium_utilA collection of useful utilities used internally in Cadmium.
cadmium_language_detectorReturns the most probable language code of the analysed text.

Installation

Your project should only include the Cadmium shard(s) you need.

However, in case you want to test out all of Cadmium in a simple way, you can install all modules of the project in a few lines.

Add this to your application's shard.yml:

dependencies:
  cadmium:
    github: cadmiumcr/cadmium
    branch: master

Contributing

  1. Fork it ( https://github.com/cadmiumcr/cadmium/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

This project exists thanks to all the people who contribute. <a href="https://github.com/cadmiumcr/Cadmium/graphs/contributors"><img src="https://opencollective.com/Cadmium/contributors.svg?width=890&button=false" /></a>