-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates in BratWriter #1169
Updates in BratWriter #1169
Conversation
1.10.0-SNAPSHOT
1 allow to have a custom html template (previously was part of the code) 2 Changes in parameter to define which element has to be shown (before was the type name) 3 Changes in parent type to allow selection of all subtypes 4 The order used to define the types to be shown is used as the order to stack them over the text (but it needs some changes in bratt js)
Can one of the admins verify this patch? |
So the same annotation can be shown in different layers displaying different fields.
Yes, I just updated it to allow multiple times the same annotation. var fragmentComparator = function(a, b) {
} I got some problems to run the default html files, because it takes the js from brat and the browser does not allow it. So I had to do my own installation of brat, and change the html (this was the reason to set the html template as a parameter) |
Thanks for the PR. Could you somehow fix it to include only the files that you actually want to contribute? A (probably) sensible process for creating a PR is like this:
After the PR is accepted, delete the feature branch. For new PRs, again create a fresh feature branch off the latest version of the official "master". Best not commit any changes to the master branch in your forked repo - it is bound to be confusing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, but there is likely more. However, it doesn't make too much sense to comment exhaustively if the PR is re-done anyway.
{ | ||
this("T" + aId, aType, aBegin, aEnd, aText); | ||
{ | ||
this("T" + String.format("%04d", aId), aType, aBegin, aEnd, aText); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you introducing 4-digit IDs? What would happen if IDs grow over 9999?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just to be able to sort by Id, so 10 goes not before 2. If the number is higher than 4 digits the program will not fail but sorting will not be optimal.
else if (fs instanceof AnnotationFS) { | ||
warnings.add("Assuming annotation type ["+fs.getType().getName()+"] is span"); | ||
writeTextAnnotation(doc, (AnnotationFS) fs); | ||
// NO writeTextAnnotation(doc, (AnnotationFS) fs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well maybe the full loop should be redone, as first it selects spans (new sorted loop) and then this second loop should be only for relations.I did not understand why after selecting/discarting the types defined by the user it was selecting everything remaining.
value=aFS.getFeatureValueAsString(aFS.getType().getFeatureByBaseName(splits[0])); | ||
} | ||
} | ||
} catch (Exception E){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of exception are you expecting here? Normally, if there is a problem that cannot be handled, the exception should be allows to fail the execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there were some cases (the ROOT of the dpendencies ) that the getFeatureValue(currentAnnot.getType().getFeatureByBaseName(splits[f])) was getFeatureValue(null) and giving an error
new pull request #1170 |
Closing as it is superseded by #1170. |
Well.. I would like the pull request to be only 2 files, the ones of brat.. but...
I did some changes (improvements) to BratWriter.
The idea was to solve some problems I found:
for example here there is a the ouptut with this code:
instead of I could get with the original component