"""Create fact_checker
Generated by Phi-Octopus Eden
2025-11-06 18:46:40.796632
"""

```python
from typing import List, Optional


class FactChecker:
    """
    A class for checking facts against a given dataset.
    
    Attributes:
        data (List[dict]): The dataset used to check facts.
    """
    
    def __init__(self, data: List[dict]):
        self.data = data

    def check_fact(self, fact_statement: str, entity_name: Optional[str] = None) -> bool:
        """
        Check if the given fact statement is true based on the dataset.
        
        Args:
            fact_statement (str): The fact statement to be checked. E.g., "John is 30 years old."
            entity_name (Optional[str]): An optional name of an entity to filter facts by. Defaults to None.
            
        Returns:
            bool: True if the fact is true, False otherwise.
        """
        for entry in self.data:
            if entity_name and entity_name not in entry:
                continue
            if fact_statement == str(entry):
                return True
        return False


# Example usage:

data = [
    {"John": 30, "city": "New York"},
    {"Alice": 25, "city": "Los Angeles"},
    {"Bob": 40, "city": "Chicago"}
]

checker = FactChecker(data)

print(checker.check_fact("John is 30 years old."))  # True
print(checker.check_fact("Alice lives in New York."))  # False

# With entity_name filter:
print(checker.check_fact("Alice is 25 years old.", "Alice"))  # True
print(checker.check_fact("Bob lives in Chicago.", "Alice"))  # False, because it's filtered by Alice

```