citesight 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/citesight.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6f66b9de41b2a4a0a02d246d159983b87073d07
|
4
|
+
data.tar.gz: be94cccf8db8a73bb7af1ec613216f635eb107a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26a9a92a8ae300c1506dfc78e684da90c90c9170272cd8deb6d40111c73dcef7498b5e7b26520242966823cdc579d4e32703b9d3f5691115f2bf65d94d93230d
|
7
|
+
data.tar.gz: 80c966d85b5074dda890e9be2753c5880541f29027ae4166099b937acdd5a873bc8fa0edd679f871f6597d12db69d00d140318e29baa445195ebc07e0de0ca1b
|
data/lib/citesight.rb
CHANGED
@@ -13,7 +13,7 @@ class PaperCitations
|
|
13
13
|
def unique_cites
|
14
14
|
# clean citations of slashes, commas, semi-colons, possesives
|
15
15
|
clean_cites = @contents.scan(cite_match).map do |c|
|
16
|
-
c[0].gsub(/[\(\),;]|([\'
|
16
|
+
c[0].gsub(/[\(\),;]|([\'\u2019]s)/, '').gsub(/[\'\u2019]\s/, ' ')
|
17
17
|
end
|
18
18
|
|
19
19
|
# create hash of citations (key) with counts (value)
|
@@ -27,14 +27,14 @@ class PaperCitations
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def name
|
30
|
-
"(#{prefix}?[A-Z][[:alpha:]\'
|
30
|
+
"(#{prefix}?[A-Z][[:alpha:]\'\u2019\-]+)" # name: caps, accents, 's
|
31
31
|
end
|
32
32
|
|
33
33
|
def cite_match
|
34
34
|
/(
|
35
35
|
#{name}{1} # first author
|
36
36
|
([ ]and[ ]#{name} | ([ ]et[ ]al.){1})? # remaining authors
|
37
|
-
([\'
|
37
|
+
([\'\u2019]s|s[\'\u2019])? # possessive form
|
38
38
|
([ ][\(]?[1-2][0-9]{3}[a-z]?[,\)\;]) # year
|
39
39
|
)/x
|
40
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: citesight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soumya Ray
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description: Extract and analyze citations from APA style
|
41
|
+
description: Extract and analyze citations from APA style text
|
42
42
|
email: soumya.ray@gmail.com
|
43
43
|
executables:
|
44
44
|
- citesight
|