text_profile_signature 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b40d0d688520628dfb1b3ae43e936d4c454753b9
4
- data.tar.gz: 14e32db1f6b8e993a4f59740f8a28aeeeace3234
3
+ metadata.gz: 70310b6de04e804854394814493932d8f67dad9b
4
+ data.tar.gz: 60456517f50a004cc609115e6b22f156cdc604eb
5
5
  SHA512:
6
- metadata.gz: c3593a2de6b6162c85c28cb55b952ab84bd81991e10ea07634de9cecc6fbef2eb2364b1b80b948824882f3acd1ce9481f6b70bd62ca2313a1ae2ec8a5af21014
7
- data.tar.gz: 5c8a4e9ec4a11208a4809cef022d22e6e6519513b7dcafad18f61695c405fd9fba7828521e7ff8d3f72122e7820cd1d514f2d22c0a5b6202be24d47f9393b9f4
6
+ metadata.gz: b4a321d0c6133b9e4873c3da426981dccf0ea7974c9e993f84604f92ee9db78bfbb11af3f218361ff15adf1368c28b7706bb1141d1a4ef43b5a439d9b3f651bc
7
+ data.tar.gz: 0218c10759f2ba6e38feb0d232e47ecd98e547c55466256b0eb5b7ac3dc78b58c77d64457f4527eb7e0aa7b8dbe407e38da96a900de9890c017e2ed5e23b0c2d
data/README.md CHANGED
@@ -53,3 +53,20 @@ puts sign
53
53
  |:----------------:|:-----:|:----------------------------------------------------------------------------------:|---------------|
54
54
  | min_token_length | int | The minimum token length to consider | 2 |
55
55
  | quant_rate | float | When multiplied by the maximum token frequency, this determines count quantization | 0.01 |
56
+
57
+ ## License
58
+
59
+ Copyright (C) 2016 Hamed Ramezanian Nik
60
+
61
+ This program is free software: you can redistribute it and/or modify
62
+ it under the terms of the GNU Lesser General Public License as published by
63
+ the Free Software Foundation, either version 3 of the License, or
64
+ (at your option) any later version.
65
+
66
+ This program is distributed in the hope that it will be useful,
67
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
68
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69
+ GNU Lesser General Public License for more details.
70
+
71
+ You should have received a copy of the GNU Lesser General Public License
72
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -20,7 +20,7 @@ require 'digest'
20
20
  require 'unicode'
21
21
 
22
22
  class TextProfileSignature
23
- VERSION = "0.0.1" unless defined? TextProfileSignature::VERSION
23
+ VERSION = "0.1.0" unless defined? TextProfileSignature::VERSION
24
24
 
25
25
  def initialize(options={})
26
26
  options[:min_token_length] ||= 2
@@ -93,13 +93,13 @@ class TextProfileSignature
93
93
  end
94
94
 
95
95
  # sort the list of tokens by decreasing frequency
96
- profile = quantized_tokens.sort {|x, y| y[:count] <=> x[:count]}
96
+ profile = quantized_tokens.sort {|x, y| [y[:count], x[:term]] <=> [x[:count], y[:term]]}
97
97
 
98
98
  # create a list of tokens and their quantized frequency,
99
99
  # separated by spaces, in the order of decreasing frequency
100
100
  quantized_frequency_str = profile.map do |a|
101
101
  "#{a[:term]} #{a[:count]}"
102
- end.join('\n')
102
+ end.join("\n")
103
103
 
104
104
  Digest::MD5.hexdigest(quantized_frequency_str)
105
105
  end
@@ -1,4 +1,4 @@
1
- :signature: 6a357987bbb275181328aec84aab0e00
1
+ :signature: d1ac43af3977ae7ddebbc77a9f3724f7
2
2
  :article: |
3
3
  Freiheit (lateinisch libertas) wird in der Regel verstanden als die Möglichkeit, ohne Zwang zwischen unterschiedlichen Möglichkeiten auswählen und entscheiden zu können. Der Begriff benennt in Philosophie, Theologie und Recht der Moderne allgemein einen Zustand der Autonomie eines Subjekts.
4
4
 
@@ -1,4 +1,4 @@
1
- :signature: f18022e6b522fa7249ab73498728c275
1
+ :signature: 0d889fc281c5272f8362c6dc14f32ee2
2
2
  :article: |
3
3
  Liberty, in philosophy, involves free will as contrasted with determinism.[1] In politics, liberty consists of the social and political freedoms enjoyed by all citizens.[2] In theology, liberty is freedom from the bondage of sin.[3] Generally, liberty seems to be distinct from freedom in that freedom concerns itself primarily, if not exclusively, with the ability to do as one wills and what one has the power to do; whereas liberty also takes into account the rights of all involved. As such, liberty can be thought of as freedom limited by rights, and therefore cannot be abused.
4
4
 
@@ -1,4 +1,4 @@
1
- :signature: 8cc2cf890f4632b55899a3184b7b4a96
1
+ :signature: 76b4b0b6ace9f7c2a9139df8aba4febf
2
2
  :article: |
3
3
  La libertad (del latín: libertas, -ātis)1 es la capacidad de la conciencia para pensar y obrar según la propia voluntad de la persona pero en sujeción a un orden o regulación más elevados.
4
4
 
@@ -1,4 +1,4 @@
1
- :signature: 728ce35eacc5e3ac743d6931f422caf0
1
+ :signature: fe41533829424ac5f98c69ee7b21fff5
2
2
  :article: |
3
3
  De façon générale, la liberté est un concept qui désigne la possibilité d'action ou de mouvement.
4
4
  En mécanique par exemple, on parle de degrés de liberté pour comptabiliser les mouvements possibles d'une pièce.
@@ -1,4 +1,4 @@
1
- :signature: 4c8484da0faa43e345d956e13a4a61f4
1
+ :signature: f2b993aadd71f422681f4ead5ea05755
2
2
  :article: |
3
3
  Per libertà s'intende la condizione per cui un individuo può decidere di pensare, esprimersi ed agire senza costrizioni, ricorrendo alla volontà di ideare e mettere in atto un'azione, mediante una libera scelta dei fini e degli strumenti che ritiene utili a realizzarla.
4
4
 
@@ -1,4 +1,4 @@
1
- :signature: f18022e6b522fa7249ab73498728c275
1
+ :signature: 975727e5e36613bf6824063a127d9738
2
2
  :article: |
3
3
  Liberdade, em filosofia, pode ser compreendida sob uma perspectiva que denota a ausência de submissão e de servidão. Ou sob outra perspectiva que é a autonomia e a espontaneidade de um sujeito racional.
4
4
 
@@ -56,7 +56,7 @@ class TextProfileSignatureGeneratorTest < TextProfileSignatureTest
56
56
  end
57
57
 
58
58
  def test_pt_lang
59
- page = get_wikipedia_article("it")
59
+ page = get_wikipedia_article("pt")
60
60
  sign = @text_profile_signature.generate_sign(page[:article])
61
61
  assert_equal sign, page[:signature]
62
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text_profile_signature
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamed Ramezanian Nik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-04 00:00:00.000000000 Z
11
+ date: 2016-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unicode