setfu 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +58 -2
- data/lib/setfu/version.rb +1 -1
- data/lib/setfu.rb +5 -2
- data/setfu.gemspec +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20de7e408d7b32f92cb46c72fb9aaaa5b3ecb21b
|
4
|
+
data.tar.gz: 0b3d9d1b0fd55b4251498ec87b2187e6236e1587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f22cc1c2ebe5ccc90043b716e6737606b758fefa3fcb5204e61cd7a0eca28413b0a71d9dd99ed9c2ba023e15bba19f1ae0e26238aeacbedc2d502e64718453e
|
7
|
+
data.tar.gz: fa7fcfb09c6916c30e32c400af291c0f9cf92e2b4614e044436d48128c427f7f127025a69d9cd6f8ffde9c98517b62a1c7945e1ae81442e7a33a6420b93fbe14
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Setfu
|
2
2
|
|
3
|
-
##Purpose
|
3
|
+
##Purpose
|
4
|
+
|
5
|
+
Creates a BitSet class with methods that allow you to construct and opperate on
|
4
6
|
set instances. A 'Bignum' instance is used internally to store each element
|
5
7
|
of the set. This allows very fast operations when comparing two set instances.
|
6
8
|
Member elements can be represented as positive small integers, or characters.
|
@@ -593,15 +595,69 @@ x === "Fred" # false , "Fred" is not a superset of x
|
|
593
595
|
x === "Fred" | x # true
|
594
596
|
```
|
595
597
|
|
598
|
+
A powerful use of the BitSet object is within the context of a case statement.
|
599
|
+
Normally, case statements test for equality and use the `===` operator for each `when` clause.
|
600
|
+
The BitSet class overloads the `===` operator, and adds new behavior by means of the #set_case method.
|
601
|
+
This is best illustrated by example as follows:
|
602
|
+
|
603
|
+
```ruby
|
604
|
+
Upper = BitSet.new.add_uppercase_chars
|
605
|
+
Lower = BitSet.new.add_lowercase_chars
|
606
|
+
Digits = ('0'..'9').to_bset
|
607
|
+
Identifier = Upper | Lower | Digits
|
608
|
+
|
609
|
+
def string_test(test)
|
610
|
+
case test.to_bset.set_case(:mode_sub)
|
611
|
+
when Digits
|
612
|
+
puts "Number"
|
613
|
+
when Upper
|
614
|
+
puts "Upper"
|
615
|
+
when Lower
|
616
|
+
puts "Lower"
|
617
|
+
when Identifier
|
618
|
+
case test[0].to_bset.set_case(:mode_intersection)
|
619
|
+
when Digits
|
620
|
+
puts "Illegal Identifier"
|
621
|
+
when Lower
|
622
|
+
puts "Identifier"
|
623
|
+
when Upper
|
624
|
+
puts "Constant Identifier"
|
625
|
+
end
|
626
|
+
else
|
627
|
+
puts "???"
|
628
|
+
end
|
629
|
+
end
|
630
|
+
|
631
|
+
string_test("Const") # Constant Identifier
|
632
|
+
string_test("nice1") # Identifier
|
633
|
+
string_test("nice") # Lower
|
634
|
+
string_test("BIG") # Upper
|
635
|
+
string_test("123") # Number
|
636
|
+
string_test("8oops") # Illegal Identifier
|
637
|
+
string_test("5 5 5") # ???
|
638
|
+
```
|
639
|
+
|
640
|
+
From the above, we see that the first-level case compares using `:mode_sub` and the second-level case statement uses an intersection test.
|
641
|
+
An equality test in this context would be useless.
|
642
|
+
An interesting behavior of the `===` operator when applied to case statements is the first opperand applies to the `when` clause,
|
643
|
+
while the last opperand applies to the case clause. This necessitates a right-to-left association when `===` is used by itself.
|
644
|
+
The intent is to target the behavior of the case statement. The `#set_case` attribute can be applied to the first or last opperand or both;
|
645
|
+
the right opperand takes precedence however.
|
646
|
+
|
596
647
|
## Revision History
|
597
648
|
|
649
|
+
### Version 3.0.1
|
650
|
+
|
651
|
+
* updated @@TRANS_HASH to include missing translation: (422,640)
|
652
|
+
* updated this document
|
653
|
+
|
598
654
|
### Version 3.0.0
|
599
655
|
|
600
656
|
* added tuple processing
|
601
657
|
* added BitSet.fill construction method
|
602
658
|
* updated utf methods
|
603
659
|
* fixed range bugs
|
604
|
-
* includes gems: primitive_wrapper, pred, betterobject, yieldhelper
|
660
|
+
* includes gems: primitive_wrapper, pred, betterobject, yieldhelper
|
605
661
|
|
606
662
|
### Older Versions
|
607
663
|
See `bdlsys.com/gems/setfu` to get older documents.
|
data/lib/setfu/version.rb
CHANGED
data/lib/setfu.rb
CHANGED
@@ -1263,7 +1263,7 @@ class BitSet
|
|
1263
1263
|
375=>374, 376=>255, 377=>378, 378=>377, 379=>380, 380=>379, 381=>382, 382=>381, 384=>579, 385=>595, 386=>387,
|
1264
1264
|
387=>386, 388=>389, 389=>388, 390=>596, 391=>392, 392=>391, 393=>598, 394=>599, 395=>396, 396=>395, 398=>477,
|
1265
1265
|
399=>601, 400=>603, 401=>402, 402=>401, 403=>608, 404=>611, 405=>502, 406=>617, 407=>616, 408=>409, 409=>408,
|
1266
|
-
410=>573, 412=>623, 413=>626, 414=>544, 415=>629, 416=>417, 417=>416, 418=>419, 419=>418, 420=>421, 421=>420,
|
1266
|
+
410=>573, 412=>623, 413=>626, 414=>544, 415=>629, 416=>417, 417=>416, 418=>419, 419=>418, 420=>421, 421=>420, 422=>640,
|
1267
1267
|
423=>424, 424=>423, 425=>643, 428=>429, 429=>428, 430=>648, 431=>432, 432=>431, 433=>650, 434=>651, 435=>436,
|
1268
1268
|
436=>435, 437=>438, 438=>437, 439=>658, 440=>441, 441=>440, 444=>445, 445=>444, 447=>503, 452=>454, 454=>452, 455=>457, 457=>455, 458=>460, 460=>458, 461=>462, 462=>461,
|
1269
1269
|
463=>464, 464=>463, 465=>466, 466=>465, 467=>468, 468=>467, 469=>470, 470=>469, 471=>472, 472=>471, 473=>474,
|
@@ -1278,7 +1278,7 @@ class BitSet
|
|
1278
1278
|
573=>410, 574=>11366, 575=>11390, 576=>11391, 577=>578, 578=>577, 579=>384, 580=>649, 581=>652, 582=>583, 583=>582,
|
1279
1279
|
584=>585, 585=>584, 586=>587, 587=>586, 588=>589, 589=>588, 590=>591, 591=>590, 592=>11375, 593=>11373, 594=>11376,
|
1280
1280
|
595=>385, 596=>390, 598=>393, 599=>394, 601=>399, 603=>400, 608=>403, 611=>404, 616=>407, 617=>406, 623=>412, 626=>413,
|
1281
|
-
629=>415, 643=>425, 648=>430, 649=>580, 650=>433, 651=>434, 652=>581, 658=>439, 913=>945, 914=>946, 915=>947, 916=>948,
|
1281
|
+
629=>415, 640=>422, 643=>425, 648=>430, 649=>580, 650=>433, 651=>434, 652=>581, 658=>439, 913=>945, 914=>946, 915=>947, 916=>948,
|
1282
1282
|
917=>949, 918=>950, 919=>951, 920=>952, 921=>953, 922=>954, 923=>955, 924=>956, 925=>957, 926=>958, 927=>959, 928=>960,
|
1283
1283
|
929=>961, 931=>963, 932=>964, 933=>965, 934=>966, 935=>967, 936=>968, 937=>969, 945=>913, 946=>914, 947=>915, 948=>916,
|
1284
1284
|
949=>917, 950=>918, 951=>919, 952=>920, 953=>921, 954=>922, 955=>923, 956=>924, 957=>925, 958=>926, 959=>927, 960=>928,
|
@@ -1374,6 +1374,9 @@ end
|
|
1374
1374
|
# now the stuff that slows down the editor ... so last goes here
|
1375
1375
|
class BitSet
|
1376
1376
|
|
1377
|
+
### SETFU 'ɶ' uppercase or lowercase ??? I have this as lowercase, but I could be wrong ...
|
1378
|
+
### leave in lowercase_dual until you get difinitive answer
|
1379
|
+
|
1377
1380
|
UTF_UPPER_CASE_CHARS = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝÞðĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉƊƋƎƏƐƑƓƔƖƗƘƜƝƟƠƢƤƦƧƩƬƮƯƱƲƳƵƷƸƼǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮǴǶǷǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃɄɅɆɈɊɌɎΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩⱭⱯⱰⱾⱿfl"
|
1378
1381
|
UTF_LOWER_CASE_CHARS = "Ðàáâãäåçèéêëìíîïñòóôõöøùúûüýþÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįĵķĺļľŀłńņňŋōŏőŕŗřśŝşšţťŧũūŭůűųŵŷźżžƀƃƅƈƌƒƕƙƚƞơƥƨƭưƴƶƹƽƿǎǐǒǔǖǘǚǜǝǟǡǥǧǩǫǭǯǵǹǻǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȥȧȩȫȭȯȱȳȼȿɀɂɇɉɋɍɏɐɑɒɓɔɖɗəɛɠɣɨɩɯɲɵʀʃʈʉʊʋʌʒαβγδεζηθικλμνξοπρςστυφχψωⱥⱦfi"
|
1379
1382
|
UTF_LOWER_CASE_DUAL_CHARS = "ȸȹijnjdždzʣʥæǣǽƣœœɶʦljʪʫijȣ"
|
data/setfu.gemspec
CHANGED
@@ -16,7 +16,6 @@ Member elements can be represented as positive small integers, or characters.
|
|
16
16
|
Sets can be constructed with integers, strings, characters, ranges, and arrays.
|
17
17
|
When characters are used, the ordinate value sets the element bit of the internal Bignum.}
|
18
18
|
spec.summary = %q{Set class}
|
19
|
-
spec.homepage = "http://bdlsys.com/gems/setfu.html"
|
20
19
|
spec.license = "MIT"
|
21
20
|
|
22
21
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: setfu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Colvin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pred
|
@@ -186,7 +186,7 @@ files:
|
|
186
186
|
- lib/setfu.rb
|
187
187
|
- lib/setfu/version.rb
|
188
188
|
- setfu.gemspec
|
189
|
-
homepage:
|
189
|
+
homepage:
|
190
190
|
licenses:
|
191
191
|
- MIT
|
192
192
|
metadata: {}
|