Hi!

I'm trying to pass a type in but I can't figure out how to achive it.
Is there any way no achive it? I.E

I can no use the property class. The equivalent code in Java works.

var input                       = createObject('java',
'java.io.StringReader').init(ad.title & ' ' & ad.desc);
var versionClass                = createObject('java',
'org.apache.lucene.util.Version');
var analyzer            = createObject('java',
'org.apache.lucene.analysis.standard.StandardAnalyzer').init(versionClass.LUCENE_35);
var tokenStream         = analyzer.tokenStream('contents', input);
var offsetAttribute     = tokenStream.getAttribute(createObject('java',
'org.apache.lucene.analysis.tokenattributes.OffsetAttribute').class);
var charTermAttribute   = tokenStream.getAttribute(createObject('java',
'org.apache.lucene.analysis.tokenattributes.CharTermAttribute').class);

while (tokenStream.incrementToken())
{
                //var startOffset       = offsetAttribute.startOffset();
                //var endOffset = offsetAttribute.endOffset();
                //var term              = charTermAttribute.toString();

                //writeDump(term);
}

//here is the equivalent code in Java
TokenStream tokenStream                 = analyzer.tokenStream(fieldName, 
reader);
OffsetAttribute offsetAttribute         =
tokenStream.getAttribute(OffsetAttribute.class);
CharTermAttribute charTermAttribute =
tokenStream.getAttribute(CharTermAttribute.class);

while (tokenStream.incrementToken())
{
    int startOffset     = offsetAttribute.startOffset();
    int endOffset       = offsetAttribute.endOffset();
    String term = charTermAttribute.toString();
}

-- 
online documentation: http://openbd.org/manual/
   google+ hints/tips: https://plus.google.com/115990347459711259462
     http://groups.google.com/group/openbd?hl=en

Reply via email to