Package: shadok
shadokA python library that permit to unleash the full efficiency of shadok's logic.InstallationUsageFAQInstallationpip3installshadokUsageShadokIntegerYou can create aShadokIntegerfrom an int or a string.fromshadokimportShadokIntegeri=ShadokInteger("BugaZoMeu")j=ShadokInteger(56)k=ShadokInteger("◿")print(i,j,k)# −𝙾ᒧ◿ ◿ᒧ𝙾 ◿print(int(i),int(j),int(k))# 75 56 3print(i.pronunciation,j.pronunciation,k.pronunciation)# BuGaZoMeu MeuZoGa MeuYou can't create aShadokIntegerfrom a string with multiple word. The following
code will raise an error. But the more you fail the closer you are to success :fromshadokimportShadokIntegerShadokInteger("Buga ZoMeu")Will get you the following error :Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shadok/shadok/shadok_integer.py", line 14, in __init__
    % value
shadok.path_to_success.ImproperShadokLogic: Cannot cast string containing
multiple words ('Buga ZoMeu') to an int.ShadokStringYou can create aShadokStringfrom a shadok sentences with multiple words
separated by spaces. If a word is an shadok integer you can get its value
withint().ShadokStringare string, it means you can create aShadokIntegerfrom one.fromshadokimportShadokStringa=ShadokString("zogabuzomEu")b=ShadokString("ZoGabuzoMeu")c=ShadokString("Gabu")c+="◿ᒧ𝙾 ZoMEU"# Mutlitple wordsprint(a,b,c)# ZoGaBuZoMeu ZoGaBuZoMeu GaBu ◿ᒧ𝙾 ZoMeuprint(int(a),int(b))# c cannot be casted to int# 539 539You can't use improper shadok syntax in aShadokString:fromshadokimportShadokStringShadokString("Gabu Gibi")Will get you the following error :Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shadok/shadok/shadok_string.py", line 42, in __init__
    MagicFaucet.check_syntax(self.raw_string)
  File "/home/shadok/shadok/magic_faucet.py", line 42, in check_syntax
    raise ImproperShadokSyntax(word, matches)
shadok.path_to_success.ImproperShadokSyntax:
Incorrect shadok syntax in 'Gibi'
                            ^^^^
Au Goulp !You can also translate a ShadokString to french :importitertoolsfromshadokimportShadokStringresult=lambdaval:print("Translation of{}:{}".format(val,ShadokString(val).translation))letters=["Ga","Bu","Zo","Meu"]forainletters:result(a)fora,binitertools.product(letters,letters):result(a+b)fora,b,cinitertools.product(letters,letters,letters):result(a+b+c)Will result in this output :Translation of Ga : {0, 'Moi', 'Intérieur', 'Non'}
Translation of Bu : {1, 'Oui', 'Eau'}
Translation of Zo : {'Nouille', 2, 'Extérieur', 'Lui'}
Translation of Meu : {'Trou', 3}
Translation of GaGa : {0, 'Toi'}
Translation of GaBu : {1, 'Notion'}
Translation of GaZo : {2}
Translation of GaMeu : {3}
Translation of BuGa : {4, 'Petite pompe'}
Translation of BuBu : {5}
Translation of BuZo : {6}
Translation of BuMeu : {7}
Translation of ZoGa : {8}
Translation of ZoBu : {9}
Translation of ZoZo : {10}
Translation of ZoMeu : {11}
Translation of MeuGa : {12}
Translation of MeuBu : {13}
Translation of MeuZo : {14}
Translation of MeuMeu : {'Trous', 15}
Translation of GaGaGa : {0, "Espèce d'imbécile"}
Translation of GaGaBu : {1}
Translation of GaGaZo : {2}
Translation of GaGaMeu : {3}
Translation of GaBuGa : {4}
Translation of GaBuBu : {5}
Translation of GaBuZo : {6}
Translation of GaBuMeu : {7}
Translation of GaZoGa : {8}
Translation of GaZoBu : {9}
Translation of GaZoZo : {10}
Translation of GaZoMeu : {11}
Translation of GaMeuGa : {12}
Translation of GaMeuBu : {13}
Translation of GaMeuZo : {14}
Translation of GaMeuMeu : {15}
Translation of BuGaGa : {16, 'Grosse pompe'}

...
Translation of MeuMeuMeu : {63}MagicFaucetTheMagicFaucetpermit to check if a string is in proper Shadok syntax :fromshadokimportMagicFaucet# Proper syntax, nothing will happenMagicFaucet.check_syntax("GabuZo")# Will raise an ImproperShadokSyntax exceptionMagicFaucet.check_syntax("GabuZoMi")Will get you the following error :Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shadok/shadok/magic_faucet.py", line 42, in check_syntax
    raise ImproperShadokSyntax(word, matches)
shadok.path_to_success.ImproperShadokSyntax:
Incorrect shadok syntax in 'GabuZoMi'
                                  ^^
Au Goulp !TheMagicFaucetalso permit to pretty print your shadok without instantiation of aShadokString:fromshadokimportMagicFaucetprint(MagicFaucet.pretty_print("meumEumEUmEu"))# 'MeuMeuMeuMeu'FAQI need to perform serious arithmetic operations on large numbers does this library provide that ?Sadly the highest order of meta-bin yet attainable is only 31. Those are big very meta bins
though.Why isGaGaGaGaGaBubecomingBuwhen I cast it toint?See "My empty meta bins are disappearing".My empty meta bins are disappearing when I create aShadokInteger?!
But I need them if my number get bigger !You should create meta bins only when you need them for efficiency.My string wasGagagaand was casted to a boolean. It returnedFalse, shouldn't it meansYou fool !and beTrueinstead ?When evaluating a string containing onlyGayou must ask yourself :
why make a simple test when a complicated one will do ? The shadok logic tell us
that we need to cast to an int when evaluating a boolean value.
We must also get rid of the empty meta bins in integer. SoGagagaequals 0,
equals[False, "You fool !"]. So when casted into a boolean you have 1 in 33
chance that its equals toFalseand 1 in 2 chance that its equal to"You fool !".
It could also beTruebut that would really be by chance and maybe by mistake.Is there any side effect to using this library ?Yes, for small operations, we're trying to rely on the new threshold required to be parent (BuBu).
If you're using the program before it was created and if the new reform
is not yet effective, we can count to the old limit (BuGa) and create one or a
few millions shadok's eggs, if we're not careful. Please however note that for big operation
this help with performance because shadok can help with parallelism as soon as they hatch,
so in this situation we're counting over 5 on purpose.Can I run this in parallel ?See question above, this is the default, but you need to count to−−first.
If you count to−𝙾or less why do you even want to run in parallel in the first
place ?Do you count to−𝙾when you pretty print using MagicFaucet ?No.I get aColanderIsInFactABusErrorwhen I instantiate myColander...Your colander seems to be a pot, please make sure your pot has a handle and is
not, in fact, a bus.