<commit_before># coding: utf-8

module ONIX
  class APAProduct < SimpleProduct

    delegate :record_reference, :record_reference=
    delegate :notification_type, :notification_type=
    delegate :product_form, :product_form=
    delegate :edition, :edition=
    delegate :number_of_pages, :number_of_pages=
    delegate :bic_main_subject, :bic_main_subject=
    delegate :publishing_status, :publishing_status=
    delegate :publication_date, :publication_date=

    def measurement_system
      @measurement_system ||= :metric
    end

    def measurement_system=(value)
      if value == :metric || value == :imperial
        @measurement_system = value
      else
        raise ArgumentError, "#{value} is not a recognised measurement system"
      end
    end

    # retrieve the current EAN
    def ean
      identifier(3).try(:id_value)
    end

    # set a new EAN
    def ean=(isbn)
      identifier_set(3, isbn)
    end

    # retrieve the proprietary ID
    def proprietary_id
      identifier(1).tr(:id_value)
    end

    # set a new proprietary ID
    def proprietary_id=(isbn)
      identifier_set(1, isbn)
    end

    # retrieve the current ISBN 10
    def isbn10
      identifier(2).try(:id_value)
    end

    # set a new ISBN 10<commit_msg>Fix typo in APAProduct method to retrieve proprietary id (ty => try)<commit_after># coding: utf-8

module ONIX
  class APAProduct < SimpleProduct

    delegate :record_reference, :record_reference=
    delegate :notification_type, :notification_type=
    delegate :product_form, :product_form=
    delegate :edition, :edition=
    delegate :number_of_pages, :number_of_pages=
    delegate :bic_main_subject, :bic_main_subject=
    delegate :publishing_status, :publishing_status=
    delegate :publication_date, :publication_date=

    def measurement_system
      @measurement_system ||= :metric
    end

    def measurement_system=(value)
      if value == :metric || value == :imperial
        @measurement_system = value
      else
        raise ArgumentError, "#{value} is not a recognised measurement system"
      end
    end

    # retrieve the current EAN
    def ean
      identifier(3).try(:id_value)
    end

    # set a new EAN
    def ean=(isbn)
      identifier_set(3, isbn)
    end

    # retrieve the proprietary ID
    def proprietary_id
      identifier(1).try(:id_value)
    end

    # set a new proprietary ID
    def proprietary_id=(isbn)
      identifier_set(1, isbn)
    end

    # retrieve the current ISBN 10
    def isbn10
      identifier(2).try(:id_value)
    end

    # set a new ISBN 10
{'fraction_non_alphanumeric': 0.07835531419705198, 'fraction_numerical': 0.009309542280837859, 'mean_word_length': 3.0046583850931676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '4310676', 'n_tokens_mistral': 808, 'n_tokens_neox': 766, 'n_words': 223}