<commit_before>package com.lysdev.transperthcached.activities.train;

import android.util.Log;
import android.content.Context;

import java.io.InputStream;
import java.io.IOException;

import org.json.JSONException;
import org.json.JSONObject;

import com.lysdev.transperthcached.utils.Util;

public class Stations {
    public static JSONObject loadJSON(Context ctx) throws JSONException {
        InputStream myInput = null;
        try {
            myInput = ctx.getAssets().open("train_stations.json");
        } catch (IOException ioe) {
            Log.e("TransperthCached", "Couldn't get station data", ioe);
            return null;
        }

        String json = "";
        try {
            json = Util.convertStreamToString(myInput);
        } catch (IOException ioe) {
            Log.e("TransperthCached", "Couldn't parse string to stream", ioe);
            return null;
        }

        return new JSONObject(json);
    }<commit_msg>Port Stations class to scala<commit_after>package com.lysdev.transperthcached.activities.train

import android.content.Context
import play.api.libs.json._
import com.lysdev.transperthcached.utils.Util

object Stations {
    def loadJSON(ctx: Context) : JsValue = {
        val myInput = ctx.getAssets.open("train_stations.json")

        Json.parse(Util.convertStreamToString(myInput))
    }

    def lineNames(ctx: Context) = {
        loadJSON(ctx).as[JsObject].keys
    }

    def stationNames(ctx: Context, line_name: String) = {
        (loadJSON(ctx) \ line_name).as[Seq[String]]
    }
{'fraction_non_alphanumeric': 0.10744336569579288, 'fraction_numerical': 0.0, 'mean_word_length': 2.9338422391857506, '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': '3108492', 'n_tokens_mistral': 472, 'n_tokens_neox': 457, 'n_words': 96}