From 1c7c588633b03e2b8d19e2bc4b3977e97556f000 Mon Sep 17 00:00:00 2001 From: Sanjaya Kumar Saxena Date: Sun, 31 Mar 2024 06:40:28 +0530 Subject: [PATCH] test(wink-nlp-specs): add test case for nbsp & markup combo --- test/wink-nlp-specs.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/wink-nlp-specs.js b/test/wink-nlp-specs.js index 2bf5de0..a8f1506 100644 --- a/test/wink-nlp-specs.js +++ b/test/wink-nlp-specs.js @@ -165,6 +165,15 @@ describe( 'wink-nlp test-coverage and basic behavior', function () { } ); } ); + it( 'should preserve non-breaking spaces with mark up', function () { + var textWith2S = 'I purchased mangoes on March\u00a010th for US$\u00a099.00.'; + var doc4mark = nlp.readDoc( textWith2S ); + doc4mark.entities().each((e) => e.markup()); + var markedText = 'I purchased mangoes on March\u00a010th for US$\u00a099.00.'; + // Reconstruction. + expect( doc4mark.out(its.markedUpText) ).to.equal( markedText ); + } ); + it( 'should not contain empty tokens', function () { var doc = nlp.readDoc( sentence ); expect( findEmptyTokens( doc ) ).deep.equal( [] );