Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soumyaray/citesight
Extracts and reports on citations in an academic text
https://github.com/soumyaray/citesight
Last synced: 3 months ago
JSON representation
Extracts and reports on citations in an academic text
- Host: GitHub
- URL: https://github.com/soumyaray/citesight
- Owner: soumyaray
- License: mit
- Created: 2014-05-24T07:09:54.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-12-27T07:17:14.000Z (11 months ago)
- Last Synced: 2024-05-12T11:21:19.424Z (6 months ago)
- Language: Ruby
- Size: 62.5 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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/large_test.txt", :encoding => "UTF-8")
paper = PaperCitations.new(contents)
cites = paper.unique_citesputs "\nTotal unique citations: #{cites.count}"
PP.pp(Hash[cites])top_cite = cites.sort_by { |_c, count| count}.reverse.first[0]
puts "\nYour top citation: #{top_cite}"top_cite_indexes = paper.index_of_cite(top_cite)
puts "It was cited at locations: #{top_cite_indexes.join(', ')}"