开发者

OS X / iOS: Labeling phrases in a text view

开发者 https://www.devze.com 2023-01-20 19:30 出处:网络
I want to build an app for the Mac / iPad that allows to assign semantic roles to sub phrases of every sentence of a text. So basically I have a text with n sentences and for every sentence the user s

I want to build an app for the Mac / iPad that allows to assign semantic roles to sub phrases of every sentence of a text. So basically I have a text with n sentences and for every sentence the user selects one or multiple words and assigns it a semantic role (e.g. agent or patient). Then, I want the according phrases to be highlighted in a different background color and a small label above or beneath it that indicates the semantic role that was assigned before.

I created a short mockup to show what this could look like:

OS X / iOS: Labeling phrases in a text view

Editing the text itself is not required at the moment, just tagging the ph开发者_JS百科rases. It would be favorable to have a solution that can be relatively easily be used both for the Mac and iOS on the iPad.

My ideas were the following: - Using a hack around UIWebView / NSWebView - Writing some own rendering code, either in conjunction with UITextView / NSTextView or completely without out.

What do you think? Are there any libraries maybe that either do that (I could not find any when searching) or that maybe help in accomplishing this, especially when going with solution 2?


It sounds like you are trying to do something similar to Joe Hewitt's TTTextPickerField in his ThreeTwenty library (see description here). He extends UITextField as opposed to UITextView and allows user editing, but perhaps you can adapt his code for rendering the highlights around completed names. The source for his library is on github.

0

精彩评论

暂无评论...
验证码 换一张
取 消