Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "number_to_word"

Title:Integer to English word conversions
Rating:Not rated. Create the first rating!
Latest version:0.4.2
SHA1 sum:e1b443e9c5d38058e8e7947ae06425135eff8f5c
Author:Ebrahim Azarisooreh <ebrahim.azarisooreh@gmail.com>
Home page:https://github.com/eazar001/number_to_word
Download URL:https://github.com/eazar001/number_to_word/archive/v0.4.2.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.3.0c2fecbb44c605e014126aa0cbcc50b7ef47d4d901https://github.com/eazar001/number_to_word/archive/v0.3.0.zip
0.3.22271f7486b0f37cfc673d99187bc49493371636f1https://github.com/eazar001/number_to_word/archive/v0.3.2.zip
0.3.31024ef1e0893d50095aea0cd56ac228c0f6d1a231https://github.com/eazar001/number_to_word/archive/v0.3.3.zip
0.3.4c7ede8b293a07e0dbfb3085d1cc6bf16027d24a71https://github.com/eazar001/number_to_word/archive/v0.3.4.zip
0.4.16d572dbbef04b0305b42d5ecae997b0a2527d15e1https://github.com/eazar001/number_to_word/archive/v0.4.1.zip
0.4.2e1b443e9c5d38058e8e7947ae06425135eff8f5c7https://github.com/eazar001/number_to_word/archive/v0.4.2.zip

What this does

This is a utility pack for converting integers to their English word representations. This was one cool feature that came built in to the Common Lisp implementation. This pack brings this functionality and other related ones to SWI Prolog.

Example usage

?- number_word([5,5,2,0,1,2,0,0,6], Word).
Word = [[five, hundred, fifty, two], million, [twelve], thousand, six]

?- number_word([0,0,6], Word).
Word = [six]

?- number_word(Number, [[one], thousand, three, hundred, seventy, two]).
Number = [0, 0, 1, 3, 7, 2]

?- number_word(Number, [[one], thousand, X, hundred, seventy, two]).
Number = [0, 0, 1, 1, 7, 2],
X = one ;
Number = [0, 0, 1, 2, 7, 2],
X = two ;
Number = [0, 0, 1, 3, 7, 2],
X = three ;
... etc.

Contents of pack "number_to_word"

Pack contains 5 files holding a total of 6.1K bytes.