【发布时间】:2012-05-09 20:17:42
【问题描述】:
在 Java 中:
TokenStream my_stream = analyser_exclude.tokenStream(fieldName, my_reader);
TermAttribute my_token = TermAttribute.getAttribute(TermAttribute.class);
在 VB.NET 中:
Dim my_stream As TokenStream = analyser_exclude.TokenStream("", my_reader)
Dim my_token As TermAttribute = DirectCast(my_stream.GetAttribute(GetType(TermAttribute)), TermAttribute)
我只是在 VB.NET 中更改了字段名,因为我不需要它。此代码适用于 VB.NET 但我不知道如何使用(在 Java 中)Termattribute.Class 更改 C# 中的 DirectCast 和最后一行代码
在 C# 中: ???
请帮帮我,我不知道如何在 C# 中更改这些行。
【问题讨论】: