<commit_before>require_relative 'base'

module OpenBEL
  module Resource
    module Expressions

      class CompletionSerializer < BaseSerializer
        adapter Oat::Adapters::HAL
        schema do
          type :completion
          property :type,           item[:type]
          property :id,             item[:id]
          property :label,          item[:label]
          property :value,          item[:value]
          property :caret_position, item[:caret_position]
        end
      end

      class CompletionResourceSerializer < BaseSerializer
        adapter Oat::Adapters::HAL
        schema do
          type :completion
          properties do |p|
            p.completion item
          end

          link :describedby, link_described_by(item[:type], item[:id])
        end

        private
<commit_msg>add "semantics" and "semantic_warnings" property<commit_after>require_relative 'base'

module OpenBEL
  module Resource
    module Expressions

      class CompletionSerializer < BaseSerializer
        adapter Oat::Adapters::HAL
        schema do
          type :completion
          property :type,              item[:type]
          property :id,                item[:id]
          property :label,             item[:label]
          property :value,             item[:value]
          property :caret_position,    item[:caret_position]
          property :semantics,         item[:semantics]
          property :semantic_warnings, item[:semantic_warnings]
        end
      end

      class CompletionResourceSerializer < BaseSerializer
        adapter Oat::Adapters::HAL
        schema do
          type :completion
          properties do |p|
            p.completion item
          end

          link :describedby, link_described_by(item[:type], item[:id])
        end

        private

{'fraction_non_alphanumeric': 0.06938325991189427, 'fraction_numerical': 0.0, 'mean_word_length': 1.8214285714285714, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3298126', 'n_tokens_mistral': 464, 'n_tokens_neox': 437, 'n_words': 120}