Please take a look in the ParserFactory, how we select the parser.
The content type information in the http header has the highest priority to select a content parser.
_In case_ this information is not available the only chance to select a parser is to appraise one based on the suffix.
Please browse the mailing list archive this mechanism was discussed ca. December 2003.


There is another suggestion i wish to do. To me it looks like only one parser per content type is supported.
Back in the days the implementation i had done, was supporting a set of content parser.


I was iterating over an array of content parsers and in case one content parser throws an parser exception the next parser was used to extract the content.
Only if all content parsers missed to extract content I had thrown a Exception.


This mechanism would allow to have a fast parser and a slower on that is more error resident.

If people think that would be useful i can provide a patch. ;)

Best,
Stefan



Am 05.06.2004 um 04:58 schrieb [EMAIL PROTECTED]:

Further suggestions:

I would allow multiple suffixes in the plugin.xml for one content
parser.

Probably not a good idea. At least, do not make this a default. There are *.php scripts which emit non text/html contents, such as image/gif, etc.

I think, ideally, a parser should only be associated with
Content-Type. It is not parser's job to determine Content-Type
by filename extension (url suffix) or any other means.

John


Now: <implementation id="net.nutch.parse.html.HtmlParser" class="net.nutch.parse.html.HtmlParser" contentType="text/html" pathSuffix="html"/>

Suggestion:
<implementation id="net.nutch.parse.html.HtmlParser"
                      class="net.nutch.parse.html.HtmlParser"
                      contentType="text/html"
                      pathSuffix="html, htm, jsp, php, asp"/>

To get this working we need to change as well one line in the
ParserFactory:
(line 103)

Now:
if (suffix.equals(extension.getAttribute("pathSuffix")))

Suggestion:
if (extension.getAttribute("pathSuffix").indexOf(suffix)=>0)


Cheers, Stefan




-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers


---------------------------------------------------------------
enterprise information technology consultanting
open technology:   http://www.media-style.com
open source:           http://www.weta-group.net
open discussion:    http://www.text-mining.org



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to