<commit_before>from superdesk.resource import Resource
from superdesk.services import BaseService
from superdesk.utc import utcnow
from flask import current_app as app
import logging


logger = logging.getLogger(__name__)


class VocabulariesResource(Resource):
    schema = {
        '_id': {
            'type': 'string',
            'required': True,
            'unique': True
        },
        'items': {
            'type': 'list',
            'required': True
        }
    }

    item_url = 'regex("[\w]+")'
    item_methods = ['GET', 'PUT']


class VocabulariesService(BaseService):
    def on_create(self, docs):
        documents = docs
        if isinstance(docs, dict):
            documents = [docs]
<commit_msg>[SD-979] modified resource methods and item methods to allow only GET for time being.<commit_after>from superdesk.resource import Resource
from superdesk.services import BaseService
from superdesk.utc import utcnow
from flask import current_app as app
import logging


logger = logging.getLogger(__name__)


class VocabulariesResource(Resource):
    schema = {
        '_id': {
            'type': 'string',
            'required': True,
            'unique': True
        },
        'items': {
            'type': 'list',
            'required': True
        }
    }

    item_url = 'regex("[\w]+")'
    item_methods = ['GET']
    resource_methods = ['GET']


class VocabulariesService(BaseService):
    def on_create(self, docs):
        documents = docs
        if isinstance(docs, dict):
            documents = [docs]

{'fraction_non_alphanumeric': 0.11096774193548387, 'fraction_numerical': 0.001935483870967742, 'mean_word_length': 2.38646288209607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2210330', 'n_tokens_mistral': 452, 'n_tokens_neox': 435, 'n_words': 122}