From c5ea39ef00273473e5d52ecfdf95bd8a075a40ab Mon Sep 17 00:00:00 2001 From: Nitzan Pomerantz <9297302+nitzpo@users.noreply.github.com> Date: Thu, 30 Oct 2025 20:33:21 +0200 Subject: [PATCH] Fix failing test --- nadlan_mcp/govmap/filters.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nadlan_mcp/govmap/filters.py b/nadlan_mcp/govmap/filters.py index 9418331..6fec5a4 100644 --- a/nadlan_mcp/govmap/filters.py +++ b/nadlan_mcp/govmap/filters.py @@ -91,10 +91,20 @@ def filter_deals_by_criteria( property_type_normalized = property_type.lower().strip() deal_type_normalized = deal_type.lower().strip() - # Check if the filter term appears in the deal type + # Handle Hebrew feminine ending variations (ה ↔ ת) + # If the filter term ends with ה, also check for the ת variant # This allows "דירה" to match "דירת גג", "דירה בבניין", etc. - if property_type_normalized not in deal_type_normalized: - continue + if property_type_normalized.endswith('ה'): + property_type_variant = property_type_normalized[:-1] + 'ת' + if property_type_variant in deal_type_normalized: + # Found variant match, continue to next filter + pass + elif property_type_normalized in deal_type_normalized: + # Found original match, continue to next filter + pass + else: + # No match found for either variant + continue # Room count filter if min_rooms is not None or max_rooms is not None: