You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ryan O'Hara <oh...@genome.chop.edu> on 2006/10/16 18:28:00 UTC
Help with Custom Analyzer
I have a few questions regarding writing a custom analyzer.
My situation is that I would like to use the StandardAnalyzer but
with some data-specific rules. I was wondering if there was a way of
telling the StandardAnalyzer to treat a string of text, that would
normally be tokenized into more than one token, as only one token
(maybe by inserting quotes around the text). For example, say the
StandardAnalyzer normally splits the string of text
ohara@genome.chop.edu into 4 tokens, but I want it to split the
string into only 1 token. Could I accomplish this by surrounding the
string with quotes or by using some other type of flag?
Another question I have is how do I modify the text being analyzed?
From how I interpreted what I have read (which could easily be off),
it looks like in order to accomplish what I have previously
described, I am going to have to add some code to my custom
analyzer's tokenStream method. I see that tokenStream() has a Field
and a Reader as parameters. Would the way I go about adding rules be
to edit the reader text? If so, would manipulation of the text be
easier if I were to convert the reader into a string?
Any help is greatly appreciated. Thanks.
-Ryan
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Help with Custom Analyzer
Posted by Ryan O'Hara <oh...@genome.chop.edu>.
Ah. Thank you. Sorry, wrong list.
-Ryan
On Oct 16, 2006, at 4:08 PM, Christopher Schultz wrote:
> Chuck,
>
> Looks like this guy accidentally posted a Lucene question to the
> Tomcat
> list. I hope he comes back to see the responses. <shrug>
>
> -chris
>
> Caldarale, Charles R wrote:
>>> From: Ryan O'Hara [mailto:ohara@genome.chop.edu]
>>> Subject: Help with Custom Analyzer
>>>
>>> I have a few questions regarding writing a custom analyzer.
>>
>> I don't get it; in what way is this associated with Tomcat?
>>
>> - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
>> PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you
>> received this in error, please contact the sender and delete the e-
>> mail
>> and its attachments from all computers.
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
===========================
Ryan O'Hara
Programmer, Center for Biomedical Informatics
The Children's Hospital of Philadelphia
3535 Market Street, Room 1406
(215)590-3243
===========================
Re: Help with Custom Analyzer
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Chuck,
Looks like this guy accidentally posted a Lucene question to the Tomcat
list. I hope he comes back to see the responses. <shrug>
-chris
Caldarale, Charles R wrote:
>> From: Ryan O'Hara [mailto:ohara@genome.chop.edu]
>> Subject: Help with Custom Analyzer
>>
>> I have a few questions regarding writing a custom analyzer.
>
> I don't get it; in what way is this associated with Tomcat?
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
RE: Help with Custom Analyzer
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ryan O'Hara [mailto:ohara@genome.chop.edu]
> Subject: Help with Custom Analyzer
>
> I have a few questions regarding writing a custom analyzer.
I don't get it; in what way is this associated with Tomcat?
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org