<commit_before>#citesight
[![Gem Version](https://badge.fury.io/rb/citesight.svg)](http://badge.fury.io/rb/citesight)
[![Build Status](https://travis-ci.org/soumyaray/citesight.svg?branch=master)](https://travis-ci.org/soumyaray/citesight)

home: [https://github.com/soumyaray/citesight](https://github.com/soumyaray/citesight)
Gem to extract and report on citations in an academic text

## Usage
This gem may be used as a command line utility or called from code

### CLI:
    citesight mydoc.txt

### Code example:
    require 'citesight'
    require 'pp'

    contents = File.open(ARGV[0], 'r').read
    res = PaperCitations.unique_cites(contents)

    puts "\nTotal unique citations: #{res.count}"
    PP.pp(Hash[res])<commit_msg>Update documentation in README.md with index_of_cite example<commit_after>#citesight
[![Gem Version](https://badge.fury.io/rb/citesight.svg)](http://badge.fury.io/rb/citesight)
[![Build Status](https://travis-ci.org/soumyaray/citesight.svg?branch=master)](https://travis-ci.org/soumyaray/citesight)

home: [https://github.com/soumyaray/citesight](https://github.com/soumyaray/citesight)
Gem to extract and report on citations in an academic text

## Usage
This gem may be used as a command line utility or called from code

### CLI:
    citesight mydoc.txt

### Code example:
    require 'citesight'
    require 'pp'

    contents = File.read('spec/testfiles/text.txt')
    cites = PaperCitations.unique_cites(contents)

    puts "\nTotal unique citations: #{cites.count}"
    PP.pp(Hash[res])

    top_cite = cites.sort_by { |_c, count| count}.reverse.first[0]
    puts "\nYour top citation: #{top_cite}"

    top_cite_indexes = PaperCitations.index_of_cite(contents, top_cite)
    puts "It was cited at locations: #{top_cite_indexes.join(', ')}"
{'fraction_non_alphanumeric': 0.14654688377316114, 'fraction_numerical': 0.0011229646266142617, 'mean_word_length': 4.483076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6129948', 'n_tokens_mistral': 649, 'n_tokens_neox': 636, 'n_words': 130}