detectWordsWithinAnnotation (str, elem) {
    let words = elem.line.annotations

    // symbols does not includes spaces as characters, but as property
    // count spaces before search text starts
    let symbolsStart = elem.text.indexOf(str)
    let spaces = elem.text
      .substring(0, symbolsStart)
      .split(' ')
      .length - 1
    // and remove spaces from start
    symbolsStart -= spaces

    // do the same with the string end
    let symbolsLength = str.length
    let start = elem.text.indexOf(str)
    let end = start + symbolsLength
    spaces = elem.text
      .substring(start, end)
      .split(' ')
      .length - 1

    symbolsLength -= spaces

    let counter = 0
    let word
    let matchedWords = []
    let index = 0

    while (counter < (symbolsStart + symbolsLength) && index < words.length) {
      word = words[index]
      counter += word.symbols.length
      if (counter > symbolsStart && counter <= (symbolsStart + symbolsLength)) {
        matchedWords.push(word)
      }
      index++
    }

    return matchedWords
  }
/**
   *
   * this method use the annotation in a paragraph from datamatrix, to detect words annotation out of a string.
   *
   */
this method use the annotation in a paragraph from datamatrix, to detect words annotation out of a string.
this method use the annotation in a paragraph from datamatrix to detect words annotation out of a string .
detectWordsWithinAnnotation (str, elem) {
    let words = elem.line.annotations
    let symbolsStart = elem.text.indexOf(str)
    let spaces = elem.text
      .substring(0, symbolsStart)
      .split(' ')
      .length - 1
    symbolsStart -= spaces
    let symbolsLength = str.length
    let start = elem.text.indexOf(str)
    let end = start + symbolsLength
    spaces = elem.text
      .substring(start, end)
      .split(' ')
      .length - 1
    symbolsLength -= spaces
    let counter = 0
    let word
    let matchedWords = []
    let index = 0
    while (counter < (symbolsStart + symbolsLength) && index < words.length) {
      word = words[index]
      counter += word.symbols.length
      if (counter > symbolsStart && counter <= (symbolsStart + symbolsLength)) {
        matchedWords.push(word)
      }
      index++
    }
    return matchedWords
  }
detectWordsWithinAnnotation ( str , elem ) { let words = elem . line . annotations let symbolsStart = elem . text . indexOf ( str ) let spaces = elem . text . substring ( 0 , symbolsStart ) . split ( ' ' ) . length - 1 symbolsStart -= spaces let symbolsLength = str . length let start = elem . text . indexOf ( str ) let end = start + symbolsLength spaces = elem . text . substring ( start , end ) . split ( ' ' ) . length - 1 symbolsLength -= spaces let counter = 0 let word let matchedWords = [ ] let index = 0 while ( counter < ( symbolsStart + symbolsLength ) && index < words . length ) { word = words [ index ] counter += word . symbols . length if ( counter > symbolsStart && counter <= ( symbolsStart + symbolsLength ) ) { matchedWords . push ( word ) } index ++ } return matchedWords }
this method use the annotation in a paragraph from datamatrix, to detect words annotation out of a string.
this method use the annotation in a paragraph from datamatrix to detect words annotation out of a string .
// symbols does not includes spaces as characters, but as property // count spaces before search text starts // and remove spaces from start // do the same with the string end