<commit_before>" cpsm - fuzzy path matcher
" Copyright (C) 2015 <NAME>
"
" Licensed under the Apache License, Version 2.0 (the "License");
" you may not use this file except in compliance with the License.
" You may obtain a copy of the License at
"
"     http://www.apache.org/licenses/LICENSE-2.0
"
" Unless required by applicable law or agreed to in writing, software
" distributed under the License is distributed on an "AS IS" BASIS,
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
" See the License for the specific language governing permissions and
" limitations under the License.

" Global variables and defaults
if !exists('g:cpsm_highlight_mode')
  let g:cpsm_highlight_mode = 'detailed'
endif
if !exists('g:cpsm_match_empty_query')
  let g:cpsm_match_empty_query = 1
endif
if !exists('g:cpsm_max_threads')
  if has('win32unix')
    " Synchronization primitives are extremely slow on Cygwin:
    " https://cygwin.com/ml/cygwin/2012-08/msg00200.html
    let g:cpsm_max_threads = 1
  else
    let g:cpsm_max_threads = 0
  endif
endif
if !exists('g:cpsm_query_inverting_delimiter')
  let g:cpsm_query_inverting_delimiter = ''
endif
if !exists('g:cpsm_unicode')
  let g:cpsm_unicode = 0
endif

let s:script_dir = escape(expand('<sfile>:p:h'), '\')

execute 'pyfile ' . s:script_dir . '/cpsm.py'

function cpsm#CtrlPMatch(items, str, limit, mmode, ispath, crfile, regex)
  if empty(a:str) && g:cpsm_match_empty_query == 0
    let s:results = a:items[0:(a:limit)]
    let s:regexes = []
  else
    let s:match_crfile = exists('g:ctrlp_match_current_file') ? g:ctrlp_match_current_file : 0
    py ctrlp_match()
  endif
  call clearmatches()
  " Apply highlight regexes.
  for r in s:regexes
    call matchadd('CtrlPMatch', r)
  endfor
  " CtrlP does this match to hide the leading > in results.
  call matchadd('CtrlPLinePre', '^>')
  return s:results
endfunction

<commit_msg>Complain about missing Python support<commit_after>" cpsm - fuzzy path matcher
" Copyright (C) 2015 <NAME>
"
" Licensed under the Apache License, Version 2.0 (the "License");
" you may not use this file except in compliance with the License.
" You may obtain a copy of the License at
"
"     http://www.apache.org/licenses/LICENSE-2.0
"
" Unless required by applicable law or agreed to in writing, software
" distributed under the License is distributed on an "AS IS" BASIS,
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
" See the License for the specific language governing permissions and
" limitations under the License.

" Global variables and defaults
if !exists('g:cpsm_highlight_mode')
  let g:cpsm_highlight_mode = 'detailed'
endif
if !exists('g:cpsm_match_empty_query')
  let g:cpsm_match_empty_query = 1
endif
if !exists('g:cpsm_max_threads')
  if has('win32unix')
    " Synchronization primitives are extremely slow on Cygwin:
    " https://cygwin.com/ml/cygwin/2012-08/msg00200.html
    let g:cpsm_max_threads = 1
  else
    let g:cpsm_max_threads = 0
  endif
endif
if !exists('g:cpsm_query_inverting_delimiter')
  let g:cpsm_query_inverting_delimiter = ''
endif
if !exists('g:cpsm_unicode')
  let g:cpsm_unicode = 0
endif

let s:script_dir = escape(expand('<sfile>:p:h'), '\')

execute 'pyfile ' . s:script_dir . '/cpsm.py'

function cpsm#CtrlPMatch(items, str, limit, mmode, ispath, crfile, regex)
  if !has('python')
    return ['ERROR: cpsm requires Vim built with Python support']
  endif
  if empty(a:str) && g:cpsm_match_empty_query == 0
    let s:results = a:items[0:(a:limit)]
    let s:regexes = []
  else
    let s:match_crfile = exists('g:ctrlp_match_current_file') ? g:ctrlp_match_current_file : 0
    py ctrlp_match()
  endif
  call clearmatches()
  " Apply highlight regexes.
  for r in s:regexes
    call matchadd('CtrlPMatch', r)
  endfor
  " CtrlP does this match to hide the leading > in results.
  call matchadd('CtrlPLinePre', '^>')
  return s:results
endfunction


{'fraction_non_alphanumeric': 0.10416666666666667, 'fraction_numerical': 0.014227642276422764, 'mean_word_length': 4.5062937062937065, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '759737', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1340, 'n_words': 408}