Exemple #1
0
    def generate_periods(self):
        cycle_1_start = 0
        cycle_1_value = simplify(self.birth.month)
        cycle_1_example = examplify(
            tranz("g.month"),
            "%02d" % self.birth.month,
            cycle_1_value
        )

        cycle_2_start = 28
        cycle_2_value = simplify(self.birth.day)
        cycle_2_example = examplify(
            tranz("g.day"),
            "%02d" % self.birth.day,
            cycle_2_value
        )

        cycle_3_start = 56
        cycle_3_value = simplify(self.birth.year)
        cycle_3_example = examplify(
            tranz("g.year"),
            "%04d" % self.birth.year,
            cycle_3_value
        )

        periods = [
            create_period(cycle_1_start, cycle_1_value, cycle_1_example),
            create_period(cycle_2_start, cycle_2_value, cycle_2_example),
            create_period(cycle_3_start, cycle_3_value, cycle_3_example)
        ]

        return periods
Exemple #2
0
    def run(self):
        year, month, day = self.birth.year, self.birth.month, self.birth.day
        num = utils.simplify(year + month + day)
        if num not in POWERS:
            # Try another way to find the power number
            num = utils.simplify(
                utils.simplify(year, keep_power=False) +
                utils.simplify(month, keep_power=False) +
                utils.simplify(day, keep_power=False))
        self._result = num

        # Compute the example
        formatted_birth = "%s + %s + %s" % (tranz("g.year"), tranz("g.month"),
                                            tranz("g.day"))
        formatted_sum = "%04d + %02d + %02d" % (year, month, day)
        self._example = utils.examplify(formatted_birth, formatted_sum,
                                        self._result)
    def run(self):
        year, month, day = self.today.year + 1, self.birth.month, self.birth.day
        num = utils.simplify(year + month + day, keep_power=False)
        self._result = num

        # Compute the example
        formatted_birth = "%s + %s + %s" % (tranz("g.u_year"),
                                            tranz("g.month"), tranz("g.day"))
        formatted_sum = "%04d + %02d + %02d" % (year, month, day)
        self._example = utils.examplify(formatted_birth, formatted_sum,
                                        self._result)
Exemple #4
0
    def generate_periods(self):
        """ Return the periods and content of the actions """

        life_path = LifePath(self.person).result
        life_path = simplify(life_path, keep_power=False)

        action_1_start = 0
        action_1_value = simplify(self.birth.month + self.birth.day)
        action_1_example = examplify(
            "%s + %s" % (tranz("g.month"), tranz("g.day")),
            "%02d + %02d" % (self.birth.month, self.birth.day),
            action_1_value
        )

        action_2_start = 36 - life_path
        action_2_value = simplify(self.birth.year + self.birth.day)
        action_2_example = examplify(
            "%s + %s" % (tranz("g.year"), tranz("g.day")),
            "%04d + %02d" % (self.birth.year, self.birth.day),
            action_2_value
        )

        action_3_start = action_2_start + 9
        action_3_value = simplify(
            simplify(action_1_value, keep_power=False) +
            simplify(action_2_value, keep_power=False)
        )
        action_3_example = examplify(
            "%s + %s" % (tranz("g.action_1"), tranz("g.action_2")),
            "%d + %d" % (action_1_value, action_2_value),
            action_3_value
        )

        action_4_start = action_3_start + 9
        action_4_value = simplify(self.birth.year + self.birth.month)
        action_4_example = examplify(
            "%s + %s" % (tranz("g.year"), tranz("g.month")),
            "%04d + %02d" % (self.birth.year, self.birth.month),
            action_4_value
        )

        periods = [
            create_period(action_1_start, action_1_value, action_1_example),
            create_period(action_2_start, action_2_value, action_2_example),
            create_period(action_3_start, action_3_value, action_3_example),
            create_period(action_4_start, action_4_value, action_4_example),
        ]
        return periods
Exemple #5
0
    def run(self):
        consonants = re.sub(re_vowels, '_', self.full_name)
        digits = utils.digitize(consonants)

        self._result = utils.simplify(digits)
        self._example = utils.examplify(consonants, digits, self._result)
Exemple #6
0
 def test_simplify_with_non_digit_only_multiple(self):
     """ Simplification of only non-digit characters should return 0 """
     digit = "__"
     self.assertEqual(0, utils.simplify(digit))
Exemple #7
0
 def test_simplify_with_non_digits(self):
     """ Simplification should work even if characters look wrong """
     digits = "12_4 6_ _"
     self.assertEqual(4, utils.simplify(digits))
Exemple #8
0
 def test_simplify_multiple_digits_power_dropped(self):
     """ Simplification of a power can be forced """
     digits = "434"
     self.assertEqual(2, utils.simplify(digits, keep_power=False))
Exemple #9
0
 def test_simplify_multiple_digits_power_kept(self):
     """ Simplification resulting in a power should keep the power by default """
     digits = "886"
     self.assertEqual(22, utils.simplify(digits))
Exemple #10
0
 def test_simplify_two_digits_power_kept(self):
     """ Simplification of a power should keep the power by default """
     digits = "11"
     self.assertEqual(11, utils.simplify(digits))
Exemple #11
0
 def test_simplify_multiple_digits(self):
     """ Simplification of a multiple digits string should return the sum of all digits """
     digits = "0123456789"  # Simple sum is 45 [(n²+n)/2]
     self.assertEqual(9, utils.simplify(digits))
Exemple #12
0
 def test_simplify_single_digit(self):
     """ Simplification of one digit should return the same digit """
     digit = "3"
     self.assertEqual(3, utils.simplify(digit))
Exemple #13
0
 def test_simplify_zero_multiple_digits(self):
     """ Zero string should simplify as zero """
     zeros = "000000"
     self.assertEqual(0, utils.simplify(zeros))
Exemple #14
0
 def test_simplify_zero_single_digit(self):
     """ Zero should simplify as zero """
     zeros = "0"
     self.assertEqual(0, utils.simplify(zeros))
Exemple #15
0
    def run(self):
        digits = utils.digitize(self.last_name)

        self._result = utils.simplify(digits)
        self._example = utils.examplify(self.last_name, digits, self._result)
Exemple #16
0
    def run(self):
        digits = utils.digitize(self.given_names)

        self._result = utils.simplify(digits)
        self._example = utils.examplify(self.given_names, digits, self._result)