Skip to content

Commit

Permalink
Update function descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Feb 27, 2024
1 parent 52aca72 commit 719144d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ARCTokenization/structural_ontologies/CodeGeneration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ module CodeGeneration =
let toCodeString (term : OboTerm) =
$" let {toUnderscoredName term} = CvTerm.create(\"{term.Id}\", \"{term.Name}\", \"{toTermSourceRef term}\"){System.Environment.NewLine}{System.Environment.NewLine}"

/// Takes a module name and a
/// Takes a module name and an OboOntology and returns the F# code of the whole term list for structural ontology libraries.
let toSourceCode moduleName (onto : OboOntology) =
let concattedSingleValues = String.init onto.Terms.Length (fun i -> $"{toCodeString onto.Terms[i]}")
let updatedBaseString = String.replace "<name>" moduleName
$"{updatedBaseString}{concattedSingleValues}"

/// Takes a module name and an OboOntology and writes the ontology's terms as F# code for structural ontology libraries as a source file at the given path.
let toFile moduleName (onto : OboOntology) path =
System.IO.File.WriteAllText(path, toSourceCode moduleName onto)

0 comments on commit 719144d

Please sign in to comment.