Bug fixes #3

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

@nubela

Allow labels for training models to use more than just capped letters, but numbers and small letters as well.

Also fixed a bug with socket shutdown in finally, rather than in try. (shutdown() can fail too)

@dat dat and 1 other commented on an outdated diff Feb 7, 2013
ner/client.py
@@ -20,7 +20,7 @@
#regex patterns for various tagging options for entity parsing
-SLASHTAGS_EPATTERN = re.compile(r'(.+?)/([A-Z]+)?\s*')
+SLASHTAGS_EPATTERN = re.compile(r'(.+?)/([0-Z]+)?\s*')
@dat
dat Feb 7, 2013

Please use [0-9a-zA-Z] for clarity sake.

@nubela
nubela Feb 7, 2013
@dat dat commented on the diff Feb 7, 2013
ner/utils.py
s.shutdown(socket.SHUT_RDWR)
s.close()
+ except:
@dat
dat Feb 7, 2013

This does not achieve the same result that I'm aiming for. When some other piece of code invokes this and gets a resulting socket and throws an error (maybe not be related to the socket), then the error gets caught by the except clause and discarded away. The socket shutdown/close lines following "yield s" never get executed and the socket doesn't get cleaned up. This change a) defeats the purpose of this function and b) obscures any exception that should be propagated upwards.

@nubela
nubela Feb 7, 2013
@dat
dat Feb 7, 2013

Great. Hope you can commercialize it. As always code contributions back, here and to the Stanford NER itself, are always welcomed.

Cheers,
Dat

@dat
Owner

Cool. Looks much better. I was thinking about including underscore _ also, but this should do for now.

@dat
Owner

I'm going to close this thread, since there's been no updated.

@dat dat closed this Oct 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment