2014-10-29 16:56:16 +01:00
|
|
|
open Core.Std;;
|
|
|
|
|
|
|
|
type t =
|
|
|
|
| Guess
|
|
|
|
| Canonical
|
|
|
|
| Natural
|
|
|
|
| Localized
|
2014-11-03 15:37:02 +01:00
|
|
|
| Orthonormalized
|
2014-10-29 16:56:16 +01:00
|
|
|
| None
|
|
|
|
with sexp
|
|
|
|
;;
|
|
|
|
|
|
|
|
let to_string = function
|
|
|
|
| Guess -> "Guess"
|
|
|
|
| Canonical -> "Canonical"
|
2014-11-03 15:37:02 +01:00
|
|
|
| Orthonormalized -> "Orthonormalized"
|
2014-10-29 16:56:16 +01:00
|
|
|
| Natural -> "Natural"
|
|
|
|
| Localized -> "Localized"
|
|
|
|
| None -> "None"
|
|
|
|
;;
|
|
|
|
|
|
|
|
let of_string s =
|
2014-12-25 23:53:29 +01:00
|
|
|
match String.lowercase (String.strip s) with
|
2014-10-29 16:56:16 +01:00
|
|
|
| "guess" -> Guess
|
|
|
|
| "canonical" -> Canonical
|
|
|
|
| "natural" -> Natural
|
|
|
|
| "localized" -> Localized
|
2014-11-03 15:37:02 +01:00
|
|
|
| "orthonormalized" -> Orthonormalized
|
2014-10-29 16:56:16 +01:00
|
|
|
| "none" -> None
|
2014-12-25 23:53:29 +01:00
|
|
|
| _ -> (print_endline s ; failwith "MO_label should be one of:
|
|
|
|
Guess | Orthonormalized | Canonical | Natural | Localized | None.")
|
2014-10-29 16:56:16 +01:00
|
|
|
;;
|