How to use the ciphey.LanguageChecker.chisquared.chiSquared function in ciphey

To help you get started, weโ€™ve selected a few ciphey examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brandonskerritt / Ciphey / tests / chi.py View on Github external
def tests_english_overflow(self):
        self.chi = chiSquared()
        """
        Tests to see whether a sentene is classified as English or not
        """
        result = self.chi.checkChi(
            "So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said."
        )
        result = self.chi.checkChi(
            "Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there."
        )
        result = self.chi.checkChi(
            "Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i."
        )
        result = self.chi.checkChi(
            "Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth."
        )
        result = self.chi.checkChi(
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def test_english_same_letter(self):
        self.chi = chiSquared()
        """
        Tests to see whether a sentene is classified as English or not
        Returns False because exclamation marks aren't english
        """
        result = self.chi.checkChi(
            "So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said."
        )
        result = self.chi.checkChi(
            "Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there."
        )
        result = self.chi.checkChi(
            "Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i."
        )
        result = self.chi.checkChi(
            "Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth."
        )
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def tests_english_caesar_true(self):
        self.chi = chiSquared()
        result = self.chi.checkChi(
            "Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba."
        )
        result = self.chi.checkChi("aolyl pz vusf ylhssf vul dhf mvy aopz av nv kvdu")
        result = self.chi.checkChi(
            "According to all known laws of aviation, there is no way for a bee to be able to fly. Its wings are simply too small for its fat tiny body."
        )
        self.assertEqual(result, True)
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def test_english_babbage(self):
            self.chi = chiSquared()
            """
            Tests to see whether a sentene is classified as English or not
            Returns False because exclamation marks aren't english
            """
            result = self.chi.checkChi(
                """Charles Babbage, FRS (26 December 1791 - 18 October 1871) was an English mathematician, philosopher, inventor and mechanical engineer who originated the concept of a programmable computer. Considered a father of the computer, Babbage is credited with inventing the first mechanical computer that eventually led to more complex designs. Parts of his uncompleted mechanisms are on display in the London Science Museum. In 1991, a perfectly functioning difference engine was constructed from Babbage's original plans. Built to tolerances achievable in the 19th century, the success of the finished engine indicated that Babbage's machine would have worked. Nine years later, the Science Museum completed the printer Babbage had designed for the difference engine."""
            )
            self.assertEqual(result, True)
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def test_english_quckbrown(self):
        self.chi = chiSquared()
        """
        Tests to see whether a sentene is classified as English or not
        """
        result = self.chi.checkChi(
            "So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said."
        )
        result = self.chi.checkChi(
            "Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there."
        )
        result = self.chi.checkChi(
            "Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i."
        )
        result = self.chi.checkChi(
            "Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth."
        )
        result = self.chi.checkChi(
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def test_chi_english_yes(self):

        """Checks to see if it returns True (it should)"""
        self.chi = chiSquared()
        """
        Tests to see whether a sentene is classified as English or not
        """
        result = self.chi.checkChi(
            "Hello my name is Brandon and I'm a top secret message"
        )
        self.assertEqual(result, True)
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def tests_english_caesar_false(self):
        self.chi = chiSquared()
        result = self.chi.checkChi(
            "Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba."
        )
        result = self.chi.checkChi("aolyl pz vusf ylhssf vul dhf mvy aopz av nv kvdu")
        result = self.chi.checkChi("vul dhf vy aol opnodhf p ht nvpun av nla fvb")
        self.assertEqual(result, False)
github brandonskerritt / Ciphey / tests / chi.py View on Github external
def test_chi_english_caps(self):
        self.chi = chiSquared()
        """
        Tests to see whether a sentene is classified as English or not
        """
        result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
        self.assertEqual(result, True)