Skip to content

Commit

Permalink
test(wink-nlp-specs): add test case for nbsp & markup combo
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayaksaxena committed Mar 31, 2024
1 parent 6314c4f commit 1c7c588
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/wink-nlp-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mark>March\u00a010th</mark> for <mark>US$\u00a099.00</mark>.';
// 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( [] );
Expand Down

0 comments on commit 1c7c588

Please sign in to comment.