UIMA ConceptMapper not finding dictionary terms in document - uima

I'm a new user of UIMA ConceptMapper. Running in debug mode, i can see that the dictionary has some items loaded, but the dict.getEntries(word) call from processTokenList() always returns null. Any suggestions welcome.

A few hints:
make sure your dictionary has some items loaded
create a smaller dictionary with 2-3 terms to test on 2-3 words

Related

Unable to view First entry of serialized lists in editor

I'm storing a list of attacks on a serialized object for a particular character, like so:
However, when collapsing the first entry of the list, it seems to bug out and behaves incorrectly, seeping into the next elements. Other elements in the list work correctly as expected.
I've been noticing this pretty consistently when working w/ serialized objects that have a list or array field as part of their serialized data. I've tried both lists and arrays and the same things happens. I don't think this happened when I was on 2018, and mainly started happening since I switched to the 2021.3.xf series
Is there a known build that fixes this? or is there some attribute I need to set to signal Unity about the field?
Grabbed a new build and it seems fixed in 2021.3.5f. Gonna mark this as the answer, it was a unity bug

NSComboBox with alternative ways of writing

I'm trying to implement a autocomplete function into a small app. I want to give the user the possibility to write down a city (from a long long list of cities) into a NSComboBox. That works fine, as long as the user is using the exact writing of the city inside my array of city names. But if they use, for whatever reason, a different spelling, it fails and the city is not found.
So if the user is looking for "Köln" for example, it's not a problem, but if he is looking for "Cologne" he wouldn't be able to find it.
For this I have, for each city an additional array of alternative spellings.
Now I would love NSComboBox (or any other type of TextField) to look not only in "city.name" but also within the array "city.alternativeNames". The shown value should as well represent what the user is writing.
I don't want to create an entry in the list of the pop-up part of NSComboBox for each alternative name, as that would make the list even longer than it is and would confuse people (cologne alone has 85 different spellings).
Thanks for your suggestions, I'm completely new to NSComboBox.
Interesting problem. I think probably you need to choose a different way to structure your data to make it easier.
Consider the lookup method (matching a string). Structuring your data for this case should account for the preferred spelling of each city (preferred by you, for the scrolled list).
How about a flat array of cities (to allow a simple search based on user spelling without also having to check each possible array of alternates and manage sorting them properly) but each has an optional (can be nil) "preferred spelling" pointer to the "correct" one. When displaying the options in the combo box, show the array filtered by those with no optional preferred spellings plus the currently-typed partial/full completion of the alternate spelling?
So a City has a name property and an optional preferred property. In your case, if Cologne is preferred, the Köln instance would have Cologne set as preferred. Köln would only appear in the list if the user typed it (even partially) and it would automatically be in the correct alpha-sorted position (assuming your cities are kept sorted).
Does this make sense or do I need to rephrase? Haven't had enough coffee this morning. :-)

Best strategies to internationalize an already-created iPhone app?

I know that to internationalize an iPhone app, you create a "strings" file in Interface Builder and set the different kinds of strings that will be displayed in your app. However, this is much easier to do starting from the outset than if you want to internationalize an already-coded, mostly-finished app. Besides the obvious hurdle of actually translating all of the text in your app, what are the best strategies for actually going about internationalizing your app when it is already created, with wacky text-modifying code and all built into the app using Objective-C functions?
The search in project function can make you save a lot of time...
I search #"" in the project and replace every occurrence with NSLocalizedString().
To save even more time:
Add the comment "// Do not localize" at the end of line of code to leave strings as is
The first parameter of NSLocalizedString should give as many details as possible. For example I use: BUTTON-ACTION-PRINT-VERB-10CHARS to indicate: user interface element type, is it a verb or a noun, the action and space available (in multiple of capital W letter).
Leave as nil the last parameter of NSLocalizedString - it's not useful
Add a comment before each string in the string file to explain context
Eliminate all the text-modifying code with formatted strings (%# %i %f)
It's the simplest way to proceed, and once it's done you can add languages with no effort!
Good luck,
rjobidon

Issue with duplicate search results and XMLParser array refresh

I use an NSXMLParser to parse ext. API data. I also use a Singleton shared array var to maintain info retrieved from ext API.
This info is dynamic and changesas the user types anything in UISearchBar
Now the thing is as soon as the user types anything, I clear off the existing array contents by using [retrievedArray removeAllObjects];
Thus this refreshed retrievedArray based on the current terms in the search bar.
This works fine if the user types slowly. However I get to see duplicate search results if the user types very fast. This, I am assuming, is because the retrievedArray contents do not get enough time to clear off.
I am still trying to resolve the issue. Please suggest some more fixes.
Could you please provide me the fix.
No, I don't think this is the case, unless you're doing search in a separate thread and clear array in another one. If not, then there is probably error in your search logic.
First of all I think a singleton approach may not be the best way to go for what you are doing. But make sure that you are synchronizing all mutable access to the array. Instead of allowing the singleton to return a NSMutableArray for any object and their mom (super) to use you need to have methods like addObject,removeObject,clear with #synchronize blocks or any kind of lock you decide on. I still see issues with this approach because the code calling addObject, remove and clear will all need to be synchronized as well. Maybe consider on each auto complete request you use a delegate or post a NSNotification containing a timestamp, the characters the user typed to get data, and a NSArray of results. At that time you can see if the response is still valid, discard any invalid responses, and update the user with just the contents of the most recent valid NSArray

Drupal - dynamic options for text_list field

I have a custom node type for which I want to have a field that uses a special combobox based on list_text. When one chooses the type list_text it is normally possible to enter a static list of selectable texts, however, I want this list to be dynamic, i.e. based on the results of a db_query. What is the best way to do this using Drupal 7?
A simple example for clarification: A node of this custom type X contains a field that points to another node, so whenever a node of type X is created I want a combobox that contains all other nodes.
(Best solution would be to only display the combobox during node creation, and no longer during edit. But I could also live with it if the combobox was shown during the edit as well.)
I have tried to customize options_select by defining my own data type and implementing hook_options_list accordingly. The combobox was displayed during creation with the correct values, however, I could not save it.. I have no idea what went wrong there, but on the first submit it would change to a different theme, and when I tried again I got an internal server error. Am I on the right track at all with defining a completely new data type for the field? there surely must be a simpler way?
You're right in that you don't need a new datatype. Here's a good tutorial on how to do this. It's not specifically for D7 but I didn't see much that wasn't still applicable. There may be a better way to do it in D7 specifically but I would love to know it too if so :)
The tutorial linked by allegroconmolto sent me on the right way. Thanks for that.
Here's the simpler way of doing it: tutorial
Basically, it is, as I assumed, a common problem and hence a simple solution for it was included in the webform module by now. It provides a hook_webform_select_options_info which can be used to register a callback method. The callback method is then called each time a corresponding option select of a webform is shown, so that you can easily fill it with the results of a dbquery or anything else. Works like a charm and takes next to no time to implement.