You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by fmccown <fm...@harding.edu> on 2009/04/09 16:49:55 UTC

Re: type is incompatible in 1.0!

Just to clarify:

Modification 1 goes in RTFParseFactory.java in the getParse function. 
You'll change the two return statements to the statements given by
buddha1021. Also you need to change the return type of getParse from Parse
to ParseResult.

Modification 2 goes in TestRTFParser.java on line 79 where the compiler is
complaining.

Regards,
Frank



buddha1021 wrote:
> 
> hi:
> you should change to this:
> 1:import org.apache.nutch.parse.ParseResult;
>    return new ParseStatus(ParseStatus.FAILED,
>                                ParseStatus.FAILED_EXCEPTION,
>                              
> e.toString()).getEmptyParseResult(content.getUrl(), getConf());
>    ParseResult parseResult = ParseResult.createParseResult(content
>             .getUrl(),
>             new ParseImpl(text,
>                     new ParseData(ParseStatus.STATUS_SUCCESS,
>                             title,
>                             OutlinkExtractor
> .                              getOutlinks(text, this.conf),
>                             content.getMetadata(),
>                             metadata)));
>     return parseResult;
> 
> 2:parse = new ParseUtil(conf).parseByExtensionId("parse-rtf",
> content).get(urlString);
> 
> 
> askNutch wrote:
>> 
>> hi all:
>>    when i use nutch in eclipse,two error occured;
>> 
>> 1 The return type is incompatible with Parser.getParse(Content)      
>> RTFParseFactory.java   
>>    the  function    is : public Parse getParse(Content content)
>>    it confuses me ,because the return type is ParseImpl which implements
>> Parse ; 
>> 
>> 2 Type is mismatch: cannot convert from ParseResult to parse          
>> TestRTFParser.java
>>    the function  is : parse = new
>> ParseUtil(conf).parseByExtensionId("parse-rtf", content) 
>>    it also confuses me ,because the return type is ParseResult which
>> implements Iterable,and the element is Map.Entry<Text, Parse> but not
>> Parse; 
>> 
>> any suggesttion?
>> 
>>   thanks very much!!!
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/type-is-incompatible-in-1.0%21-tp22778406p22972521.html
Sent from the Nutch - User mailing list archive at Nabble.com.