org.clulab.wm.eidoscommon.utils.YamlUtils.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eidos-eidoscommon_2.12 Show documentation
Show all versions of eidos-eidoscommon_2.12 Show documentation
Code to be shared by other Eidos subprojects and clients
The newest version!
package org.clulab.wm.eidoscommon.utils
import java.util.{Map => JMap}
import org.yaml.snakeyaml.Yaml
import org.yaml.snakeyaml.constructor.Constructor
object YamlUtils {
val yaml = new Yaml
def escape(string: String): String = yaml.dump(string)
def newRules(input: String): Array[JMap[String, String]] = {
val yaml = new Yaml(new Constructor(classOf[Array[JMap[String, String]]]))
val rule = yaml.load(input).asInstanceOf[Array[JMap[String, String]]]
rule
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy