lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Türkay Kaynak (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (LUCENENET-544) Turkish stemmer causes an IndexOutOfRange
Date Sat, 15 Aug 2015 21:22:45 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14698460#comment-14698460
] 

Türkay Kaynak edited comment on LUCENENET-544 at 8/15/15 9:22 PM:
------------------------------------------------------------------

And location...

SnowballProgram.cs

{code}
		protected internal virtual int replace_s(int c_bra, int c_ket, System.String s)
		{
			int adjustment = s.Length - (c_ket - c_bra);
            		if (current.Length > bra) 
			//<--!! 'bra' is '0'. Caller(s): TurkishStemmer.r_postlude() -> TurkishStemmer.r_append_U_to_stems_ending_with_d_or_g()
-> insert() -> replace_s()
    				current.Replace(current.ToString(bra, ket - bra), s, bra, ket - bra);
            		else
                		current.Append(s);
			limit += adjustment;
			if (cursor >= c_ket)
				cursor += adjustment;
			else if (cursor > c_bra)
				cursor = c_bra;
			return adjustment;
		}

{code}


was (Author: arionwm):
{code}
		protected internal virtual int replace_s(int c_bra, int c_ket, System.String s)
		{
			int adjustment = s.Length - (c_ket - c_bra);
            		if (current.Length > bra) 
			//<--!! 'bra' is '0'. Caller(s): TurkishStemmer.r_postlude() -> TurkishStemmer.r_append_U_to_stems_ending_with_d_or_g()
-> insert() -> replace_s()
    				current.Replace(current.ToString(bra, ket - bra), s, bra, ket - bra);
            		else
                		current.Append(s);
			limit += adjustment;
			if (cursor >= c_ket)
				cursor += adjustment;
			else if (cursor > c_bra)
				cursor = c_bra;
			return adjustment;
		}

{code}

> Turkish stemmer causes an IndexOutOfRange
> -----------------------------------------
>
>                 Key: LUCENENET-544
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-544
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net Contrib
>         Environment: Windows 7 x64, .NET 4.0
>            Reporter: Peter Wright
>         Attachments: Program.cs, Turkish.txt, Turkish3.txt, Visual Studio with exception
details.png
>
>
> Certain words in the Turkish stemmer is causing SnowballProgram to throw an index out
of range exception in the method "find_among_b(Among[] v, int v_size)".
> Line 353
> diff = current[c - 1 - common] - w.s[i2];
> current[c - 1 - common]	'current[c - 1 - common]' threw an exception of type 'System.IndexOutOfRangeException'
char {System.IndexOutOfRangeException}
> -		current	{ı}	System.Text.StringBuilder
> 		Length	1	int
> 		c	8	int
> 		common	0	int



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message