cld3 3.4.4 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/README.md +4 -7
  4. data/cld3.gemspec +5 -5
  5. data/ext/cld3/Makefile +17 -16
  6. data/ext/cld3/base.o +0 -0
  7. data/ext/cld3/cld_3/protos/feature_extractor.pb.h +100 -0
  8. data/ext/cld3/cld_3/protos/sentence.pb.h +35 -0
  9. data/ext/cld3/cld_3/protos/task_spec.pb.h +106 -0
  10. data/ext/cld3/embedding_feature_extractor.o +0 -0
  11. data/ext/cld3/embedding_network.o +0 -0
  12. data/ext/cld3/extconf.rb +1 -10
  13. data/ext/cld3/feature_extractor.o +0 -0
  14. data/ext/cld3/feature_types.o +0 -0
  15. data/ext/cld3/fixunicodevalue.o +0 -0
  16. data/ext/cld3/fml_parser.o +0 -0
  17. data/ext/cld3/generated_entities.o +0 -0
  18. data/ext/cld3/generated_ulscript.o +0 -0
  19. data/ext/cld3/getonescriptspan.cc +0 -2
  20. data/ext/cld3/getonescriptspan.o +0 -0
  21. data/ext/cld3/lang_id_nn_params.o +0 -0
  22. data/ext/cld3/language_identifier_features.o +0 -0
  23. data/ext/cld3/libcld3.so +0 -0
  24. data/ext/cld3/nnet_language_identifier.o +0 -0
  25. data/ext/cld3/nnet_language_identifier_c.o +0 -0
  26. data/ext/cld3/offsetmap.o +0 -0
  27. data/ext/cld3/registry.o +0 -0
  28. data/ext/cld3/relevant_script_feature.o +0 -0
  29. data/ext/cld3/script_span/fixunicodevalue.h +69 -0
  30. data/ext/cld3/script_span/generated_ulscript.h +142 -0
  31. data/ext/cld3/script_span/getonescriptspan.h +124 -0
  32. data/ext/cld3/script_span/integral_types.h +37 -0
  33. data/ext/cld3/script_span/offsetmap.h +168 -0
  34. data/ext/cld3/script_span/port.h +143 -0
  35. data/ext/cld3/script_span/stringpiece.h +81 -0
  36. data/ext/cld3/script_span/text_processing.h +30 -0
  37. data/ext/cld3/script_span/utf8acceptinterchange.h +486 -0
  38. data/ext/cld3/script_span/utf8prop_lettermarkscriptnum.h +1631 -0
  39. data/ext/cld3/script_span/utf8repl_lettermarklower.h +758 -0
  40. data/ext/cld3/script_span/utf8scannot_lettermarkspecial.h +1455 -0
  41. data/ext/cld3/script_span/utf8statetable.h +285 -0
  42. data/ext/cld3/sentence_features.o +0 -0
  43. data/ext/cld3/task_context.o +0 -0
  44. data/ext/cld3/task_context_params.o +0 -0
  45. data/ext/cld3/text_processing.o +0 -0
  46. data/ext/cld3/unicodetext.o +0 -0
  47. data/ext/cld3/utf8statetable.o +0 -0
  48. data/ext/cld3/utils.o +0 -0
  49. data/ext/cld3/workspace.o +0 -0
  50. data/lib/cld3.rb +4 -1
  51. metadata +33 -25
  52. data/ext/cld3/feature_extractor.pb.o +0 -0
  53. data/ext/cld3/feature_extractor.proto +0 -50
  54. data/ext/cld3/mkmf.log +0 -37
  55. data/ext/cld3/sentence.pb.o +0 -0
  56. data/ext/cld3/sentence.proto +0 -77
  57. data/ext/cld3/task_spec.pb.o +0 -0
  58. data/ext/cld3/task_spec.proto +0 -98
  59. data/lib/a.rb +0 -24
@@ -1,98 +0,0 @@
1
- /* Copyright 2016 Google Inc. All Rights Reserved.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
- ==============================================================================*/
15
-
16
- // LINT: ALLOW_GROUPS
17
- // Protocol buffer specifications for task configuration.
18
-
19
- syntax = "proto2";
20
- option optimize_for = LITE_RUNTIME;
21
-
22
- package chrome_lang_id;
23
-
24
- // Task input descriptor.
25
- message TaskInput {
26
- // Name of input resource.
27
- required string name = 1;
28
-
29
- // Name of stage responsible of creating this resource.
30
- optional string creator = 2;
31
-
32
- // File format for resource.
33
- repeated string file_format = 3;
34
-
35
- // Record format for resource.
36
- repeated string record_format = 4;
37
-
38
- // Is this resource multi-file?
39
- optional bool multi_file = 5 [default = false];
40
-
41
- // An input can consist of multiple file sets.
42
- repeated group Part = 6 {
43
- // File pattern for file set.
44
- optional string file_pattern = 7;
45
-
46
- // File format for file set.
47
- optional string file_format = 8;
48
-
49
- // Record format for file set.
50
- optional string record_format = 9;
51
- }
52
- }
53
-
54
- // Task output descriptor.
55
- message TaskOutput {
56
- // Name of output resource.
57
- required string name = 1;
58
-
59
- // File format for output resource.
60
- optional string file_format = 2;
61
-
62
- // Record format for output resource.
63
- optional string record_format = 3;
64
-
65
- // Number of shards in output. If it is different from zero this output is
66
- // sharded. If the number of shards is set to -1 this means that the output is
67
- // sharded, but the number of shard is unknown. The files are then named
68
- // 'base-*-of-*'.
69
- optional int32 shards = 4 [default = 0];
70
-
71
- // Base file name for output resource. If this is not set by the task
72
- // component it is set to a default value by the workflow engine.
73
- optional string file_base = 5;
74
-
75
- // Optional extension added to the file name.
76
- optional string file_extension = 6;
77
- }
78
-
79
- // A task specification is used for describing executing parameters.
80
- message TaskSpec {
81
- // Name of task.
82
- optional string task_name = 1;
83
-
84
- // Workflow task type.
85
- optional string task_type = 2;
86
-
87
- // Task parameters.
88
- repeated group Parameter = 3 {
89
- required string name = 4;
90
- optional string value = 5;
91
- }
92
-
93
- // Task inputs.
94
- repeated TaskInput input = 6;
95
-
96
- // Task outputs.
97
- repeated TaskOutput output = 7;
98
- }
data/lib/a.rb DELETED
@@ -1,24 +0,0 @@
1
- require "cld3"
2
-
3
- # Kafka text as an example + the word Velcro
4
- text = "Πολυαγαπημένε πατέρα πρόσφατα Velcro με ρώτησες κάποια φορά γιατί ισχυρίζομαι πως σε φοβάμαι. Εγώ δεν ήξερα, ως συνήθως, τι να σου απαντήσω, εν μέρει ακριβώς λόγω του φόβου που νιώθω για σένα, εν μέρει επειδή στην αιτιολόγηση του φόβου αυτού συγκαταλέγονται πάρα πολλές λεπτομέρειες, που εν τη ρύμη του λόγου εγώ ούτε κατά το ήμισυ δεν θα μπορούσα να τις συγκρατήσω. Κι αν εδώ προσπαθώ να σου απαντήσω γραπτώς, μόνο ανολοκλήρωτο κατά πολύ θα αποβεί και τούτο, επειδή και κατά τη γραφή ο φόβος και οι συνέπειές του με κωλύουν έναντί σου κι επειδή το μέγεθος του υλικού εν γένει υπερβαίνει κατά πολύ τη μνήμη μου και το λογικό μου. Για σένα το ζήτημα αποδεικνυόταν πάντοτε πολύ απλό, τουλάχιστον στον βαθμό που μιλούσες εσύ γι’ αυτό ενώπιόν μου και, αδιακρίτως, ενώπιον πολλών άλλων. Εσένα σου φαινόταν να είναι κάπως έτσι: Εσύ εργαζόσουν σκληρά σ’ όλη σου τη ζωή, τα πάντα για τα παιδιά σου, προ πάντων για εμένα τα θυσίαζες, εγώ έκαμνα συνεπώς «ζωή χαρισάμενη», είχα πλήρη ελευθερία να μάθω ό,τι ήθελα, κανέναν λόγο δεν είχα να έχω έγνοιες για την καθημερινή διατροφή, να έχω έγνοιες συνεπώς εν γένει• εσύ αντ’ αυτών καμμίαν ευγνωμοσύνη δεν αξίωνες, γνωρίζεις «την ευγνωμοσύνη των παιδιών, αλλά εν τούτοις τουλάχιστον μια "
5
- pp text.bytesize
6
-
7
- 200.times { |i|
8
- max_bytes = 500 + i * 10
9
- cld3 = CLD3::NNetLanguageIdentifier.new("foo", max_bytes)
10
-
11
- lang = cld3.find_language(text)
12
- lang2 = cld3.find_top_n_most_freq_langs(text, 1)
13
-
14
- puts "When max_bytes is #{max_bytes} probability is less than 0.999: #{lang.probability}" if lang.probability < 0.999
15
-
16
- if lang.language != :el
17
- puts "When max_bytes is #{max_bytes} then cld3::find_language returns #{lang.language},
18
- find_top_n_most_freq_langs returns #{lang2.first.language}"
19
- #pp lang
20
- #pp lang2
21
- end
22
- }
23
-
24
- puts "Size: #{text.length} - Bytesize: #{text.encode(Encoding::UTF_8).bytesize}"