<commit_before>from .base import Base

class Source(Base):
    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'phpcd'
        self.mark = '[phpcd]'
        self.filetypes = ['php']
        self.is_bytepos = True
        self.input_pattern = '\w+|[^. \t]->\w*|\w+::\w*'
        self.rank = 500
        self.max_pattern_length = -1
        self.matchers = ['matcher_full_fuzzy']

    def get_complete_position(self, context):
        return self.vim.call('phpcd#CompletePHP', 1, '')

    def gather_candidates(self, context):
        return self.vim.call('phpcd#CompletePHP', 0, context['complete_str'])<commit_msg>fix deoplete error<commit_after>from .base import Base
from neovim.api.nvim import NvimError

class Source(Base):
    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'phpcd'
        self.mark = '[phpcd]'
        self.filetypes = ['php']
        self.is_bytepos = True
        self.input_pattern = '\w+|[^. \t]->\w*|\w+::\w*'
        self.rank = 500
        self.max_pattern_length = -1
        self.matchers = ['matcher_full_fuzzy']

    def get_complete_position(self, context):
        return self.vim.call('phpcd#CompletePHP', 1, '')

    def gather_candidates(self, context):
        try:
            return self.vim.call('phpcd#CompletePHP', 0, context['complete_str'])
        except NvimError:
            return []
{'fraction_non_alphanumeric': 0.1459227467811159, 'fraction_numerical': 0.008583690987124463, 'mean_word_length': 2.532828282828283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4614441', 'n_tokens_mistral': 486, 'n_tokens_neox': 453, 'n_words': 91}