Commit e19c70aa authored by reddyk's avatar reddyk
Browse files

ENA-2344

parent 0392f3eb
......@@ -26,4 +26,5 @@ public abstract class BlockReader extends FlatFileLineReader {
public abstract String getTag();
protected abstract void read(String block);
}
}
......@@ -109,15 +109,17 @@ public abstract class MultiLineBlockReader extends BlockReader {
}
String blockString = block.toString();
//blockString=EntryUtils.convertNonAsciiStringtoAsciiString(blockString);
if(!lineReader.isIgnoreParseError())
{
blockString=StringEscapeUtils.unescapeHtml4(blockString);
String blockStringwithNohtmlEntity=StringEscapeUtils.unescapeHtml4(blockString);
Matcher m = htmlEntityRegexPattern.matcher(blockString);
Matcher m = htmlEntityRegexPattern.matcher(blockStringwithNohtmlEntity);
if (m.find())
{
error("FF.15",getTag());
}
}
if (concatenateType != ConcatenateType.CONCATENATE_BREAK) {
// Remove double spaces.
blockString = FlatFileUtils.shrink(blockString);
......
......@@ -45,6 +45,8 @@ public class QualifierMatcher extends FlatFileMatcher {
Qualifier qualifier=qualifierFactory.createQualifier(qualifierName);
if (qualifierValue != null)
{
if(!getReader().getLineReader().isIgnoreParseError())
{
if (!qualifier.isValueQuoted() && nofQuotes != 0)
{
if (!qualifier.getName().equals(Qualifier.COMPARE_QUALIFIER_NAME) )
......@@ -73,6 +75,7 @@ public class QualifierMatcher extends FlatFileMatcher {
{
error("FT.13", qualifierName, qualifierValue);
}
}
qualifierValue = FlatFileUtils.trimLeft(qualifierValue, '"');
qualifierValue = FlatFileUtils.trimRight(qualifierValue, '"');
......
......@@ -37,6 +37,11 @@ public class OSReader extends MultiLineBlockReader {
protected void read(String block) {
OrganismMatcher organismMatcher = new OrganismMatcher(this);
if (!organismMatcher.match(block)) {
if(lineReader.isIgnoreParseError())
{
getCache().setScientificName(block);
}
else
error("FF.10", block);
return;
}
......
......@@ -15,6 +15,7 @@
******************************************************************************/
package uk.ac.ebi.embl.flatfile.reader.embl;
import uk.ac.ebi.embl.api.entry.reference.ReferenceFactory;
import uk.ac.ebi.embl.flatfile.EmblTag;
import uk.ac.ebi.embl.flatfile.FlatFileUtils;
import uk.ac.ebi.embl.flatfile.reader.LineReader;
......@@ -40,6 +41,11 @@ public class RAReader extends MultiLineBlockReader {
for (String author : FlatFileUtils.split(block, ",")) {
EmblPersonMatcher personMatcher = new EmblPersonMatcher(this);
if (!personMatcher.match(author)) {
if(lineReader.isIgnoreParseError())
{
getCache().getPublication().addAuthor((new ReferenceFactory()).createPerson(block));
}
else
error("RA.1", author);
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment