Changeset 39 in code for trunk/lib/text.ml
- Timestamp:
- Dec 12, 2022, 10:52:55 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/text.ml
r38 r39 26 26 let set key m = try String_map.find (String.lowercase_ascii key) m.stringset_map with Not_found -> String_set.empty 27 27 let str_set key m = String_set.to_string @@ set key m 28 let with_str_set m key str = { m with29 stringset_map = String_map.add (String.lowercase_ascii key) ( String_set.of_stringstr) m.stringset_map28 let with_str_set ?(separator=String_set.of_csv_string) m key str = { m with 29 stringset_map = String_map.add (String.lowercase_ascii key) (separator str) m.stringset_map 30 30 } 31 31 … … 40 40 | "date" -> { x with date = Date.{ x.date with created = Date.of_string v }} 41 41 | "date-edited"-> { x with date = Date.{ x.date with edited = Date.of_string v }} 42 | "licences" | "topics" | "keywords" | "references" | "series" as k -> with_str_set x k v 42 | "licences" | "topics" | "keywords" | "series" as k -> with_str_set x k v 43 | "references" -> with_str_set 44 ~separator:(fun x -> String_set.map (fun x -> String.(sub x 1 (length x-2))) 45 (String_set.of_ssv_string x)) 46 x k v 43 47 | k -> { x with string_map = String_map.add k (trim v) x.string_map } 44 48
Note:
See TracChangeset
for help on using the changeset viewer.