Skip to content

Commit

Permalink
Setup Bulgarian language and Numeral Dimension
Browse files Browse the repository at this point in the history
Summary:
- Setup Bulgarian (BG) language
- Added Numeral Dimension
Closes #78

Reviewed By: niteria

Differential Revision: D5575513

Pulled By: patapizza

fbshipit-source-id: e566155
  • Loading branch information
st0yanov authored and facebook-github-bot committed Aug 9, 2017
1 parent 9037126 commit 5d03b45
Show file tree
Hide file tree
Showing 13 changed files with 513 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Duckling/Dimensions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import qualified Data.HashSet as HashSet
import Duckling.Dimensions.Types
import qualified Duckling.Dimensions.Common as CommonDimensions
import qualified Duckling.Dimensions.AR as ARDimensions
import qualified Duckling.Dimensions.BG as BGDimensions
import qualified Duckling.Dimensions.CS as CSDimensions
import qualified Duckling.Dimensions.DA as DADimensions
import qualified Duckling.Dimensions.DE as DEDimensions
Expand Down Expand Up @@ -78,6 +79,7 @@ dependents (This Volume) = HashSet.singleton (This Numeral)

langDimensions :: Lang -> [Some Dimension]
langDimensions AR = ARDimensions.allDimensions
langDimensions BG = BGDimensions.allDimensions
langDimensions CS = CSDimensions.allDimensions
langDimensions DA = DADimensions.allDimensions
langDimensions DE = DEDimensions.allDimensions
Expand Down
18 changes: 18 additions & 0 deletions Duckling/Dimensions/BG.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- 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.Dimensions.BG
( allDimensions
) where

import Duckling.Dimensions.Types

allDimensions :: [Some Dimension]
allDimensions =
[ This Numeral
]
1 change: 1 addition & 0 deletions Duckling/Lang.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import qualified TextShow as TS

data Lang
= AR
| BG
| CS
| DA
| DE
Expand Down
127 changes: 127 additions & 0 deletions Duckling/Numeral/BG/Corpus.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
-- 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.


{-# LANGUAGE OverloadedStrings #-}

module Duckling.Numeral.BG.Corpus
( corpus ) where

import Data.String
import Prelude

import Duckling.Lang
import Duckling.Numeral.Types
import Duckling.Resolve
import Duckling.Testing.Types

corpus :: Corpus
corpus = (testContext {lang = BG}, allExamples)

allExamples :: [Example]
allExamples = concat
[ examples (NumeralValue 0)
[ "0"
, "нула"
]
, examples (NumeralValue 1)
[ "1"
, "един"
, "една"
, "едно"
]
, examples (NumeralValue 2)
[ "2"
, "02"
, "две"
, "два"
]
, examples (NumeralValue 3)
[ "3"
, "03"
, "три"
]
, examples (NumeralValue 4)
[ "4"
, "04"
, "четири"
]
, examples (NumeralValue 5)
[ "5"
, "05"
, "пет"
]
, examples (NumeralValue 33)
[ "33"
, "0033"
, "тридесет и три"
]
, examples (NumeralValue 14)
[ "14"
, "четиринадесет"
, "четиринайсет"
]
, examples (NumeralValue 15)
[ "15"
, "петнадесет"
, "петнайсет"
]
, examples (NumeralValue 16)
[ "16"
, "шестнадесет"
, "шестнайсет"
]
, examples (NumeralValue 17)
[ "17"
, "седемнадесет"
, "седемнайсет"
]
, examples (NumeralValue 18)
[ "18"
, "осемнадесет"
, "осемнайсет"
]
, examples (NumeralValue 525)
[ "525"
, "петстотин двадесет и пет"
]
, examples (NumeralValue 1.1)
[ "1.1"
, "1.10"
, "01.10"
, "1 цяло и 1"
, "едно цяло и едно"
]
, examples (NumeralValue 0.77)
[ "0.77"
, ".77"
]
, examples (NumeralValue 100000)
[ "100000"
, "100к"
, "100К"
]
, examples (NumeralValue 3000000)
[ ""
, "3000К"
, "3000000"
, "3,000,000"
]
, examples (NumeralValue 1200000)
[ "1200000"
, "1.2М"
, "1200К"
, ".0012Г"
]
, examples (NumeralValue (-1200000))
[ "-1200000"
, "минус 1200000"
, "-1.2М"
, "-1200К"
, "-.0012Г"
]
]
Loading

0 comments on commit 5d03b45

Please sign in to comment.