<commit_before>class Repositext
  class RFile
    # Represents a content AT file in repositext.
    class ContentAt < RFile

      include FollowsStandardFilenameConvention
      include HasCorrespondingDataJsonFile
      include HasCorrespondingPrimaryFile

      # Returns an array of ContentAt files under repo_root_dir/content_type dir.
      # @param repo_root_dir [String]
      # @param content_type [Repositext::ContentType]
      def self.find_all(repo_root_dir, content_type)
        Dir.glob(File.join(repo_root_dir, '**/content/**/*.at')).map { |path|
          RFile::ContentAt.new(
            File.read(path),
            content_type.language,
            path,
            content_type
          )
        }
      end

      def compute_similarity_with_corresponding_primary_file
        Kramdown::TreeStructuralSimilarity.new(
          corresponding_primary_file.kramdown_doc,
          kramdown_doc
        ).compute
      end

      def corresponding_subtitle_import_markers_file<commit_msg>RFile::ContentAt: Fixed .find_all method to be limited to the given content_type<commit_after>class Repositext
  class RFile
    # Represents a content AT file in repositext.
    class ContentAt < RFile

      include FollowsStandardFilenameConvention
      include HasCorrespondingDataJsonFile
      include HasCorrespondingPrimaryFile

      # Returns an array of ContentAt files under repo_root_dir/content_type dir.
      # @param repo_root_dir [String]
      # @param content_type [Repositext::ContentType]
      def self.find_all(repo_root_dir, content_type)
        Dir.glob(File.join(repo_root_dir, "**/ct-#{ content_type.name }/content/**/*.at")).map { |path|
          RFile::ContentAt.new(
            File.read(path),
            content_type.language,
            path,
            content_type
          )
        }
      end

      def compute_similarity_with_corresponding_primary_file
        Kramdown::TreeStructuralSimilarity.new(
          corresponding_primary_file.kramdown_doc,
          kramdown_doc
        ).compute
      end

      def corresponding_subtitle_import_markers_file
{'fraction_non_alphanumeric': 0.0670760510155881, 'fraction_numerical': 0.0, 'mean_word_length': 2.6707105719237436, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6797058', 'n_tokens_mistral': 615, 'n_tokens_neox': 593, 'n_words': 123}