<commit_before>package org.libreoffice;

import android.graphics.Bitmap;

import org.mozilla.gecko.gfx.BufferedCairoImage;
import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.LayerController;
import org.mozilla.gecko.gfx.SubTile;

public class MockTileProvider implements TileProvider {
    private final LayerController layerController;
    private static final int TILE_SIZE = 256;

    public MockTileProvider(LayerController layerController) {
        this.layerController = layerController;
    }

    @Override
    public int getPageWidth() {
        return 549;
    }

    @Override
    public int getPageHeight() {
        return 630*5;
    }

    @Override
    public boolean isReady() {
        return true;
    }

    @Override
    public SubTile createTile(int x, int y) {
        int tiles = (getPageWidth() / TILE_SIZE) + 1;
        int tileNumber = (y / TILE_SIZE) * tiles + (x / TILE_SIZE);
        tileNumber %= 9;
        tileNumber += 1; // 0 to 1 based numbering

        String imageName = "d" + tileNumber;
        Bitmap bitmap = layerController.getDrawable(imageName);

        CairoImage image = new BufferedCairoImage(bitmap);
        SubTile tile = new SubTile(image, x, y);
        tile.beginTransaction();

        return tile;
    }
}
<commit_msg>LOAndroid3: change MockTileProvider to accept filename<commit_after>package org.libreoffice;

import android.graphics.Bitmap;

import org.mozilla.gecko.gfx.BufferedCairoImage;
import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.LayerController;
import org.mozilla.gecko.gfx.SubTile;

public class MockTileProvider implements TileProvider {
    private static final int TILE_SIZE = 256;
    private final LayerController layerController;
    private final String inputFile;

    public MockTileProvider(LayerController layerController, String inputFile) {
        this.layerController = layerController;
        this.inputFile = inputFile;
    }

    @Override
    public int getPageWidth() {
        return 549;
    }

    @Override
    public int getPageHeight() {
        return 630*5;
    }

    @Override
    public boolean isReady() {
        return true;
    }

    @Override
    public SubTile createTile(int x, int y) {
        int tiles = (getPageWidth() / TILE_SIZE) + 1;
        int tileNumber = (y / TILE_SIZE) * tiles + (x / TILE_SIZE);
        tileNumber %= 9;
        tileNumber += 1; // 0 to 1 based numbering

        String imageName = "d" + tileNumber;
        Bitmap bitmap = layerController.getDrawable(imageName);

        CairoImage image = new BufferedCairoImage(bitmap);
        SubTile tile = new SubTile(image, x, y);
        tile.beginTransaction();

        return tile;
    }
}

{'fraction_non_alphanumeric': 0.0874678427048879, 'fraction_numerical': 0.01139287026828372, 'mean_word_length': 2.8230337078651684, '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': '3636374', 'n_tokens_mistral': 841, 'n_tokens_neox': 786, 'n_words': 209}