python LG core propagation

owly

闇の伝説
Staff member
戦闘 コーダー
project progress at 100%
 
0% 100%


1. AbsDictionaryDB :s24:
2. enumFail :s24:
3. Mutatable :s24:
4. MemoryMutatable (+optional test classes T1:Mutatable, T2:Mutatable) :s24:
5. APSay:Mutatable :s24:
6. DeepCopier (not needed in java version) :s24:
7. APVerbatim:Mutatable :s24:
8. enumTimes :s24:
9. PlayGround :s24:
10. GrimoireMemento :s24:
11. Algorithm :s24:
12. CldBool :s24:
13. APCldVerbatim:APVerbatim :s24:
14. Kokoro :s24:
15. Neuron :s24:
16. DiSkillUtils :s24:
17. DiSkillV2 :s24:
18. DiSkillV3:DiSkillV2 :s24:
19. DiHelloWorld:DiSkillV2 :s24:
20. LGPointDouble :s24:
21. LGPointInt :s24:
22. enum enumRegexGrimoire :s24:
23. RegexUtil :s24:
24. TimeGate :s24:
25. Cerabellum :s24:
26. DExplorer :s24:
27. PriorityQueue<T> (not needed in java version) :s24:
29. FusionCera:Cerabellum :s24:
30. Fusion :s24:
(depracate) Personality
31. Thinkable :s24:
32. Chobits:Thinkable :s24:
33. Actionable :s24:
34. Brain :s24:

 
Last edited by a moderator:

fukurou

the supreme coder
ADMIN
Python:
from LivinGrimoireCore import *


class Personality2(PersonalityLight):
    # Override
    def __init__(self, *absDictionaryDB: AbsDictionaryDB):
        super().__init__(absDictionaryDB)
        super().getdClassesLv1().append(DiHelloWorld(self.getKokoro()))


if __name__ == "__main__":
    test_personality: Personality2 = Personality2()
    chii: ChobitsLight = ChobitsLight(test_personality)
    result = chii.think("hello", "", "")
    print(result)

for reference that is the before
the personality cls will be redundant
and the kokoro will be handled in the BG
 

fukurou

the supreme coder
ADMIN
Python:
if __name__ == "__main__":
    test:APVerbatim = APVerbatim("hello","world")
    print(test.action("","",""))
    print(test.action("", "", ""))
    print(test.action("", "", ""))
 

fukurou

the supreme coder
ADMIN
Python:
    a1 = DiHelloWorld()
    a1.input("hello","","")
    n1 = Neuron()
    a1.output(n1)
    print(n1.algParts[0].algParts[0].action("hello","",""))
    print(n1.algParts[0].algParts[0].action("", "", ""))
 

fukurou

the supreme coder
ADMIN
Python:
''' ----------------- REGEXUTIL ---------------- '''

class LGPointInt:
    def __init__(self, x_init:int, y_init:int):
        self.x:int = x_init
        self.y:int = y_init

    def shift(self, x:int, y:int):
        self.x += x
        self.y += y

    def __repr__(self):
        return "".join(["Point(", str(self.x), ",", str(self.y), ")"])


def distance(a, b):
    return sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2)


class LGPointFloat:
    def __init__(self, x_init:float, y_init:float):
        self.x:float = x_init
        self.y:float = y_init

    def shift(self, x:float, y:float):
        self.x += x
        self.y += y

    def __repr__(self):
        return "".join(["Point(", str(self.x), ",", str(self.y), ")"])


def distance(a, b):
    return sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2)

 

fukurou

the supreme coder
ADMIN
Python:
class enumRegexGrimoire(Enum):
    email = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
    timeStamp = "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"
    integer = "[-+]?[0-9]{1,13}"
    double_num = "[-+]?[0-9]*[.,][0-9]*"
    repeatedWord = "\\b([\\w\\s']+) \\1\\b"
    phone = "[0]\\d{9}"
    trackingID = "[A-Z]{2}[0-9]{9}[A-Z]{2}"
    IPV4 = "([0-9].){4}[0-9]*"
    domain = "[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
    number = "\\d+(\\.\\d+)?"
    secondlessTimeStamp = "[0-9]{1,2}:[0-9]{1,2}"
    date = "[0-9]{1,4}/[0-9]{1,2}/[0-9]{1,2}"
    fullDate = "[0-9]{1,4}/[0-9]{1,2}/[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"
 

fukurou

the supreme coder
ADMIN
Python:
''' Chobits CLASS '''


class Chobits(Thinkable):

    def __init__(self):
        super().__init__()
        self.emot: str = ""  # emotion
        self.dClasses: list[DiSkillV2] = []
        # algorithms fusion (polymarization)
        self.algDurations: dict[str, int] = {}
        self.fusion: Fusion = Fusion(self.algDurations)
        self.noiron: Neuron = Neuron()
        # added :
        self.kokoro: Kokoro = Kokoro(AbsDictionaryDB())  # soul
        self.lastOutput: str = ""
        # standBy phase 260320
        self.timeGate: TimeGate = TimeGate(5)

    def doIt(self, ear: str, skin: str, eye: str) -> str:
        ear = self.translateIn(ear)
        for dCls in self.dClassesLv1:
            self.inOut(dCls, ear, skin, eye)
        self.fusion.setAlgQueue(self.noiron)
        return self.translateOut(self.fusion.act(ear, skin, eye))

    def getSoulEmotion(self) -> str:
        return self.kokoro.getEmot()

    def getEmot(self) -> str:
        # emot (emotion for display)
        x1: str = self.emot
        return x1

    def inOut(self, dClass: DiSkillV2, ear: str, skin: str, eye: str):
        dClass.input(ear, skin, eye)  # new
        dClass.output(self.noiron)

    def translateIn(self, earIn: str) -> str:
        # makes sure the chobit doesn't feedback on her own output
        if (earIn == self.lastOutput):
            return ""
        return earIn

    def translateOut(self, outResult: str) -> str:
        # save last output served
        if (outResult != ""):
            self.lastOutput = outResult
            self.timeGate.open(5)
            self.kokoro.standBy = False
        # standBy :
        else:
            if (self.timeGate.isClosed()):
                self.kokoro.standBy = True
                self.timeGate.open(5)
            else:
                self.kokoro.standBy = False
        return outResult

    # Override
    def think(self, ear: str, skin: str, eye: str) -> str:
        return self.doIt(ear, skin, eye)

    def getStandby(self) -> bool:
        return self.kokoro.standBy
I'll continue later
 
Top