"""Create fact_checker
Generated by Phi-Octopus Eden
2025-11-07 16:36:42.971212
"""

```python
from typing import List, Dict


class FactChecker:
    """
    A class that provides a basic fact-checking capability by comparing given facts against known data.
    """

    def __init__(self, knowledge_base: Dict[str, str]):
        """
        Initialize the FactChecker with a knowledge base.

        :param knowledge_base: Dictionary containing key-value pairs of factual information
        """
        self.knowledge_base = knowledge_base

    def check_fact(self, fact_to_check: str) -> bool:
        """
        Check if a given fact is true based on the knowledge base.

        :param fact_to_check: The fact to be checked as a string.
        :return: True if the fact is in the knowledge base, False otherwise.
        """
        return fact_to_check.lower() in [f.lower() for f in self.knowledge_base.keys()]

    def find_matching_facts(self, query: str) -> List[str]:
        """
        Find facts that match a given query.

        :param query: The query string to search the knowledge base against.
        :return: A list of matching fact keys from the knowledge base.
        """
        query_lower = query.lower()
        return [key for key in self.knowledge_base if query_lower in key.lower()]

    def add_fact(self, new_fact: str, value: str):
        """
        Add a new fact to the knowledge base.

        :param new_fact: The key representing the new fact.
        :param value: The corresponding value of the new fact.
        """
        self.knowledge_base[new_fact] = value


# Example usage
knowledge = {
    "the earth orbits the sun": "True",
    "water freezes at 0 degrees Celsius": "True",
    "pythagoras theorem": "a² + b² = c²"
}

fact_checker = FactChecker(knowledge)
print(fact_checker.check_fact("The Earth orbits the Sun"))  # True
print(fact_checker.find_matching_facts("freezing temperature of water"))  # ["water freezes at 0 degrees Celsius"]
fact_checker.add_fact("new moon", "occurs when the sun and moon are aligned")
print(fact_checker.knowledge_base)
```