swiftswift3swift3.2

Replace string text to particular text in an array string with in ios swift


entities = ({confidence = "<null>"; end = 113; entity = DATE; extractor = "ner_spacy";start = 103;value = "five years"; }, {confidence = "<null>"; end = 177;entity = ORG; extractor = "ner_spacy";start = 163; value = "xyz Company"; } );

This is the backend data, I need to display in string with remove and add the new values in a string text:

Example: "In your {{years_of_experience}} of experience at {{ORG}}, what kind of process improvements or standards setup?"

Answer : Array of 0 ---> five years and Array of 1 ---> xyz Company Instead of open and closed curly brackets, I need to show this text of array 0 and 1.

In your five years of experience at xyz company, what kind of process improvements or standards setup?


Solution

  • It is not working for dynamic data, In some text doesn't contain any key values and {{}}, In that case how we will write this.

    I need to display an tableview with this type of data and play the voice message.

    Example: q1) Can you please explain to me about yourself, highlighting the number of years of experience relevant to Project Manager and different domains you worked on

    Answer: User says the answer, sends the backend and stored the response in a dictionary.

    Q2) In your {{years_of_experience}} of experience at {{ORG}}, what kind of process improvements or standards setup? Note: 1) I need to replace the text value inside of the {{ }} 2) For some question text there is no entity key and value. 3) We need to store {{ORG}} value and Whenever question text inside {{ORG}} we should replace the value of entity.

    Q3) Could you tell me a few Software development methodologies and what you have used and are comfortable with?

    q4) Great. Can you name a few clients you were supporting in {{industry}} domain and {{years_of_experience}}?

    ------------ and Soon.

    I stored the entity key and value response whenever says the answers with respective text