mirror of
https://github.com/facebook/duckling.git
synced 2024-11-28 16:54:59 +03:00
b00e5faeac
Summary: The numerical ordinal matching rule in DE is too broad. An ordinal like "1." may not be proceeded or followed by numbers. * Added negative lookbehind - avoids matching the first "1." in "1.1" as an ordinal. * Added negative lookahead - avoids matching the second "1." in "1.1. as an ordinal Closes https://github.com/facebookincubator/duckling/pull/18 Reviewed By: patapizza Differential Revision: D5069200 Pulled By: niteria fbshipit-source-id: 0583076
25 lines
657 B
Haskell
25 lines
657 B
Haskell
-- Copyright (c) 2016-present, Facebook, Inc.
|
|
-- All rights reserved.
|
|
--
|
|
-- This source code is licensed under the BSD-style license found in the
|
|
-- LICENSE file in the root directory of this source tree. An additional grant
|
|
-- of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
|
module Duckling.Ordinal.DE.Tests
|
|
( tests ) where
|
|
|
|
import Prelude
|
|
import Data.String
|
|
import Test.Tasty
|
|
|
|
import Duckling.Dimensions.Types
|
|
import Duckling.Ordinal.DE.Corpus
|
|
import Duckling.Testing.Asserts
|
|
|
|
tests :: TestTree
|
|
tests = testGroup "DE Tests"
|
|
[ makeCorpusTest [This Ordinal] corpus
|
|
, makeNegativeCorpusTest [This Ordinal] negativeCorpus
|
|
]
|