摘要: scala 将字典转换成Json字符串 import scala.util.parsing.json.JSONObject JSONObject.apply(wordsMap).toString() 阅读全文
posted @ 2020-11-10 13:51 JunCode 阅读(759) 评论(0) 推荐(0) 编辑
摘要: 输入一个word列表和一个empty的map /** * 计算列表词频,返回一个map * * @param list * @param map * @return */ @scala.annotation.tailrec def generateMap(list: List[String], ma 阅读全文
posted @ 2020-11-10 12:00 JunCode 阅读(480) 评论(0) 推荐(0) 编辑
摘要: 类型属性和类型方法方法 类型属性 使用关键字static来定义结构体和枚举的类型属性,关键字class来为类定义类型属性。 语法: struct Structname { static var storedTypeProperty = " " static var computedTypePrope 阅读全文
posted @ 2020-11-10 10:31 JunCode 阅读(723) 评论(0) 推荐(0) 编辑