views:

80

answers:

4

What would be an intelligent way to store text, so that it can be intelligently parsed and translated later on.

For example, The employee is outstanding as he can identify his own strengths and weaknesses and is comfortable with himself.

The above could be the generic text which is shown to the user prior to evaluation. If the user is a Male (say Shaun) or female (say Mary), the above text should be translated as follows.

Mary is outstanding as she can identify her own strengths and weaknesses and is comfortable with herself.

Shaun is outstanding as he can identify his own strengths and weaknesses and is comfortable with himself.

  1. How do we store the evaluation criteria in the first place with appropriate place or token holders. (In the above case employee should be translated to employee name and based on his gender the words he or she, himself or herself needs to be translated)

  2. Is there a mechanism to automatically translate the text with the above information.

+1  A: 

This is a very broad question in the field of Natural Language Processing. There are numerous ways to go around it, the questions you asked seem too broad.

If I understand correctly part of your question this could be done this way :

@variable{name} is outstanding as @gender{he/she} can identify @gender{his/hers} own strengths and weaknesses and is comfortable with @gender{himself/herself}.

Or:

@name is outstanding as @he can identify @his own strengths and weaknesses and is comfortable with @himself.

... if gender is the major problem.

Kornel Kisielewicz
Currently the list of variable parameters is restricted to name, gender (he | she, him | her, himself | herself) ...
Joshua
A: 

I have had some experience working with a tool called Grammatica, when building a custom user input excel like formula parsing and evaluation engine. It may not be to the level of sophistication you're looking for but it's a start. This basically uses many of the same concepts that popular code compiler parsers employ. It's definitely worth checking out.

James
+1  A: 

The basic idea of doing something like this is called Mail Merge.
This page seems to discus how to implement something like this in Ruby.

[Edit]
A google search gave me this - http://freemarker.org/ alt text
I don't know much about this library, but it looks like what you need.

adi92
The explanation is useful, but I am looking for a Java based solution.
Joshua
A: 

I agree with Kornel, this question is too broad. What you seem to be talking about is semantics for which RDF's and OWL can be a good starting point. Read about modeling semantics using markup and you can work your way up from there.

Ritesh M Nayak
I would prefer a simpler approach compared to RDF, OWL which I am not that familiar with.
Joshua