(Lucene.Net) Turkish stemmer is causing SnowballProgram to throw an index out of range exception. How to fix it? - lucene.net

Certain words in the Turkish stemmer is causing SnowballProgram to throw an index out of range exception. Can anybody help me to solve this problem?

Related

String index out of range: -1 in dell boomi

I am getting This Error "String index out of range: -1".
does this have something to do with the input data like any character or something?
Can anyone please explain me the root cause of this error and how do i resolve?

Unable to deciper formula field syntax

I'm trying to decipher a Crystal Reports formula field, but I'm not sure what this syntax is saying. I understand what the ISNULL() is for, but does the >"." mean?
if isnull({r.userid}) or not ({r.userid}>".") then {r.empID} else {r.userid}}
What is the or not ({r.userid}>".") statement saying? I don't follow the logic in that.
That's an interesting way to do this but it is basically saying
if userid is null or if the asci value of the first character of userid is NOT greater than 46. This will return The username if it is not null or starts with anything other than special characters.

Crash with Lucene.NET when using Sort

I have a date field inserted in a Lucene database with the following code:
Document.Add(new NumericField("TimeStamp", Field.Store.YES, true).SetLongValue(Data.TimeStamp.ToBinary()));
And I have the following query:
var Sort = new Sort(new SortField("TimeStamp", SortField.LONG, true));
var ParsedQuery = ParseQuery(_Parser, SearchQuery);
var Filter = new QueryWrapperFilter(ParsedQuery);
var Hits = _Searcher.Search(ParsedQuery, Filter, Skip + Limit, Sort);
But it crashes when executing the search method with the following:
A first chance exception of type 'Lucene.Net.QueryParsers.QueryParser.LookaheadSuccess' occurred in Lucene.Net.dll
A first chance exception of type 'System.IO.IOException' occurred in Lucene.Net.dll
A first chance exception of type 'System.IO.IOException' occurred in Lucene.Net.dll
A first chance exception of type 'System.AccessViolationException' occurred in HDIndexing.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
If I replace the Sort variable with one of the constants, such as Sort.RELEVANCE then the search works properly.
The problem comes from my custom search.
Incidentally I noticed something else odd and I do not know if these is a connection: If I inspect my Lucene DB with the Luke tool, all my fields are reported to be strings:
http://i.stack.imgur.com/SnlSD.png
I do not know if this is a bug in Luke or something is wrong with how Lucene is set up on my end.
I tried to change the sort to a type 'string' to see what would happen, but it crashes the same way, so either way, the type of the field doesn't seem to have an impact.
Has anyone experienced that problem before?
It could be similar to someone else's post: lucene.net sort not working access violation

Throw "out of range" in matlab

I have a case where I want to throw an out of range exception in matlab, but also give the reason to why the vector goes out of range (bad backward compatibility). It is of course possible to have some kind of fprintf()... error('out of range'). However, it feels like it may be good to go the proper way here, as
try
a = b(c);
catch err
throw(err,'Identifier');
error('lack support for particular case');
end
The question is: How to create err?; And also: What is the identifier for "out of range" called in matlab?
The reason that the error message is different is because for the fprintf case the out of range should not be passed with only a comment.
In the statement
try
doSomethingThatMayResultInError();
catch me
doSomethingWithTheError(me);
end
me is an object of class MException that contains all information, including stack trace, of the error.
If you would like to add additional information to the error you're throwing, you can do it the following way:
try
doSomethingThatMayResultInError(a,b);
catch me
%# throw a more easy-to-understand error
error(['This use case, i.e. with length of a (%i) different from length of b (%i)'...
'is not supported. Error details: %s'], length(a), length(b), me.message)
end
Of course, you can make error handling more involved by adding e.g. switch/case statements with error identifiers (me.identifier), although you should be advised that error identifiers have been changing a few times in the last few versions of Matlab.
I'm not sure what you mean by 'how to create me?', that gets created for you when the error is thrown. As for checking the identifier, why not just throw the error yourself and inspect the me object (although I think me is a bad name so I'm going to use err instead):
try
a = b(c); %// making sure that the error you want occurs!
catch err
disp(err.identifier);
end

An appearance was requested without a variable text field

I have come across this error while trying to fill in a form field. I really have no idea what it means and only occurs on some of the PDFs that I have.
I found it being thrown from AcroFields.java here:
if (!PdfName.CH.equals(fieldType))
throw new DocumentException("An appearance was requested without a variable text field.");
Could anyone provide insight into this error and what is causing it?
You're using a very old version of iText, please upgrade!
In the most recent version, exceptions are localized:
if (!PdfName.CH.equals(fieldType))
throw new DocumentException(MessageLocalization.getComposedMessage(
"an.appearance.was.requested.without.a.variable.text.field"));
As for your question: the error tells you exactly what is happening. You are setting a value for a field for which two or more appearances are defined. However, the value you've chosen is an invalid value.
For instance: you have a check box for which the possible states are "Off" and "On", but you're trying to set the value "1". There is no appearance defined for the value "1" hence the exception.