parameters: (self, s, dict)
return_statement: return "".join(result)
docstring: :type s: str
          :type dict: List[str]
          :rtype: str
docstring_summary: :type s: str
          :type dict: List[str]
          :rtype: str
docstring_tokens: : type s : str : type dict : List [ str ] : rtype : str
function: def addBoldTag(self, s, dict):
          """
          :type s: str
          :type dict: List[str]
          :rtype: str
          """
          lookup = [0] * len(s)
          for d in dict:
              pos = s.find(d)
              while pos != -1:
                  lookup[pos:pos+len(d)] = [1] * len(d)
                  pos = s.find(d, pos + 1)
  
          result = []
          for i in xrange(len(s)):
              if lookup[i] and (i == 0 or not lookup[i-1]):
                  result.append("<b>")
              result.append(s[i])
              if lookup[i] and (i == len(s)-1 or not lookup[i+1]):
                  result.append("</b>")
          return "".join(result)
function_tokens: def addBoldTag ( self , s , dict ) : lookup = [ 0 ] * len ( s ) for d in dict : pos = s . find ( d ) while pos != - 1 : lookup [ pos : pos + len ( d ) ] = [ 1 ] * len ( d ) pos = s . find ( d , pos + 1 ) result = [ ] for i in xrange ( len ( s ) ) : if lookup [ i ] and ( i == 0 or not lookup [ i - 1 ] ) : result . append ( "<b>" ) result . append ( s [ i ] ) if lookup [ i ] and ( i == len ( s ) - 1 or not lookup [ i + 1 ] ) : result . append ( "</b>" ) return "" . join ( result )