code: def soundex_ar(word):
      if word[0] in "\u0627\u0623\u0625\u0622":
          word = word[1:]
  
      r = "0"
      prevcode = "0"
      if len(word) > 1:
          # Discard the first character
          for char in word[1:]:
              if char in _arabic_codes:
                  code = _arabic_codes.get(char, "0")
              # Don't append the code if it's the same as the previous
              if code != prevcode:
                  # If the code is a 0 (vowel), don't process it
                  if code != "0":
                      r += code
              prevcode = code
      return r
  
imports: import re
  from whoosh.compat import iteritems
label_desc: Use image node_id 3 for calling a global function with example usage: soundex_ar(word) and returns: r