海运补问保留贸易条款;陆运多车型价表按列回填,车型码不进起始地
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -335,6 +335,21 @@ class OralExtractTests(unittest.TestCase):
|
||||
self.assertIn("重量(KG):1.5KG", shown)
|
||||
self.assertNotIn("1.5KGS", shown)
|
||||
|
||||
def test_broken_decimal_space_keeps_full_weight_volume(self) -> None:
|
||||
"""小数点后空格不得只抽到小数段:578. 5KG/1. 03CBM → 578.5KG/1.03CBM。"""
|
||||
from agent.schema.field_validate import harvest_oral_measures
|
||||
|
||||
text = "1个木箱/578. 5KG/1. 03CBM空运普货1箱托盘到MAA"
|
||||
facts = harvest_oral_measures(text, {})
|
||||
self.assertEqual(facts.get("毛重"), "578.5KG")
|
||||
self.assertEqual(facts.get("体积"), "1.03CBM")
|
||||
self.assertNotEqual(facts.get("毛重"), "5KG")
|
||||
self.assertNotEqual(facts.get("体积"), "03CBM")
|
||||
|
||||
fullwidth = harvest_oral_measures("茶叶,578. 5KG,1。03CBM,托盘", {})
|
||||
self.assertEqual(fullwidth.get("毛重"), "578.5KG")
|
||||
self.assertEqual(fullwidth.get("体积"), "1.03CBM")
|
||||
|
||||
def test_dimension_text_is_volume_without_multiplying(self) -> None:
|
||||
from agent.schema.field_validate import harvest_oral_measures
|
||||
|
||||
|
||||
Reference in New Issue
Block a user