我有Intellij-IDEA 13.1.2.[编辑,以前的13.0.2]我使用scala-plugin.我正在尝试使用工作表来评估代码.
但我得到的只是两个错误:
bad macro impl binding: versionFormat is supposed to be there
Unable to read an event from: rO0ABXNyADVvcmcuamV0YnJhaW5zLmpwcy5pbmNyZW1lbnRhbC...
Run Code Online (Sandbox Code Playgroud)
我可以正常运行scala控制台并在其中执行我的代码,但工作表不起作用.如果我的代码不正确,它会输出一个错误,指示解释器无法解析我的代码.只有在我的代码正确的情况下,我才会收到"错误的宏impl绑定"错误.
我尝试创建一个新项目,但它没有用.我按照教程在intellij中配置scala,但它也没有帮助.
我可能错过了一个重要的配置步骤吗?这个错误意味着什么?
编辑:我在我的工作表中尝试了最简单的事情,如1或var x = 1或println("Hello World!")
编辑2:我不知道我改变了什么,但现在我有另一个错误:错误:加载MacroPrinter时出错,缺少MacroPrinter所需的类文件.包反射的参考值宏指的是不存在的符号.
更新:现在它在Intellij 13.1.5,Scala插件0.41.2以及scala-2.10和2.11下工作正常
中大约有 98,000 个句子(长度从 5 - 100 个单词)lst_train,而 中大约有 1000 个句子(长度从 5 - 100 个单词)lst_test。对于 中的每个句子,lst_test我想查找它是否抄袭了 中的句子lst_train。如果这个句子是抄袭的,我应该返回 lst_train 中的 id,否则返回 null。
现在我想计算 中每个句子相lst_test对于 中每个句子的杰卡德相似度lst_train。这是我的代码,b.JaccardSim 计算两个句子的 jaccard 相似度:
lst_all_p = []
for i in range(len(lst_test)):
print('i:', i)
lst_p = []
for j in range(len(lst_train)):
b = textSimilarity.TextSimilarity(lst_test[i], lst_train[j])
lst_p.append(b.JaccardSim(b.str_a,b.str_b))
lst_all_p.append(lst_p)
Run Code Online (Sandbox Code Playgroud)
但我发现lst_train中每一句话计算一次的时间都超过1分钟。由于大约有1000个句子,所以可能需要大约1000分钟才能完成。太长了。
你们知道如何使计算速度更快或更好的方法来解决检测 lst_train 中句子抄袭的问题吗?
我一直在尝试编写 UTF-16 字符串结构,尽管标准库提供了一个unicode模块,但它似乎没有提供打印出u16. 我试过这个:
const std = @import("std");
const unicode = std.unicode;
const stdout = std.io.getStdOut().outStream();
pub fn main() !void {
const unicode_str = unicode.utf8ToUtf16LeStringLiteral(" hello! ");
try stdout.print("{}\n", .{unicode_str});
}
Run Code Online (Sandbox Code Playgroud)
这输出:
[12:0]u16@202e9c
Run Code Online (Sandbox Code Playgroud)
有没有办法打印 unicode 字符串 ( []u16) 而不将其转换回非 unicode 字符串 ( []u8)?