class_docstr: For `SWIG <http://www.swig.org/>`_ source code.
  
  .. versionadded:: 2.0
class_docstr_tok: ["For","`","SWIG","<","http",":","\/\/www.swig.org\/",">","`","_","source","code",".","..","versionadded",":",":","2.0"]
code: def analyse_text(text):
      rv = 0
      # Search for SWIG directives, which are conventionally at the beginning of
      # a line. The probability of them being within a line is low, so let another
      # lexer win in this case.
      matches = re.findall(r"^\s*(%[a-z_][a-z0-9_]*)", text, re.M)
      for m in matches:
          if m in SwigLexer.swig_directives:
              rv = 0.98
              break
          else:
              rv = 0.91  # Fraction higher than MatlabLexer
      return rv
  
imports: import re
  from pygments.lexer import RegexLexer, include, bygroups, inherit, words, default
  from pygments.token import Text, Comment, Operator, Keyword, Name, String, Number, Punctuation
  from pygments.lexers.c_cpp import CLexer, CppLexer
  from pygments.lexers import _mql_builtins
label_desc: Use image node_id 1 for calling the SwigLexer obj's underlying member method code with example usage: obj.analyse_text(text) and returns: rv