+
+let toRomanNumber (v : int) : string =
+ let rec decompose (v : int) : string =
+ if v >= 1000 then
+ "M" + decompose (v - 1000)
+ elif v >= 900 then
+ "CM" + decompose (v - 900)
+ elif v >= 500 then
+ "D" + decompose (v - 500)
+ elif v >= 400 then
+ "CD" + decompose (v - 400)
+ elif v >= 100 then
+ "C" + decompose (v - 100)
+ elif v >= 90 then
+ "XC" + decompose (v - 90)
+ elif v >= 50 then
+ "L" + decompose (v - 50)
+ elif v >= 40 then
+ "XL" + decompose (v - 40)
+ elif v >= 10 then
+ "X" + decompose (v - 10)
+ elif v >= 9 then
+ "IX" + decompose (v - 9)
+ elif v >= 5 then
+ "V" + decompose (v - 5)
+ elif v >= 4 then
+ "IV" + decompose (v - 4)
+ elif v >= 1 then
+ "I" + decompose (v - 1)
+ else
+ ""
+ decompose v
+
+let argsHelp =
+ let programName = System.AppDomain.CurrentDomain.FriendlyName
+ "Usage of Parasitemia:\n" +
+ "Non-interactive mode:\n" +
+ (sprintf " %s (--folder <folder>|--file <file>) --output <folder> [--debug]\n" programName) +
+ " --folder <folder> : an input folder containing images to analyze\n" +
+ " --file <file> : an image file to be analyzed\n" +
+ " --output <folder> : a folder to put the results\n" +
+ " --debug : output more information like intermediate images (it takes more CPU and memory)\n" +
+
+ "Interactive mode:\n" +
+ (sprintf " %s [<document-file>] [--debug]\n" programName) +
+ " <document-file> : a PIAZ file to automatically open at startup\n" +
+ " --debug : output information like intermediate images in the current directory (it takes more CPU and memory)"
\ No newline at end of file