<commit_before>package com.conveyal.gtfs;

import com.conveyal.gtfs.model.Route;
import com.conveyal.gtfs.model.Stop;
import com.conveyal.gtfs.stats.RouteStats;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

/**
 * Summarize frequencies, designed for use in the KCMO transportation system.
 */
public class FrequencySummary {
    private static final LocalTime[] windows = new LocalTime[] {
            LocalTime.of(6, 0),
            LocalTime.of(9, 0),
            LocalTime.of(16, 0),
            LocalTime.of(18, 0),
            LocalTime.of(22, 0)
    };

    private static final LocalDate date = LocalDate.of(2016, 8, 30);

    public static void main(String... args) throws IOException {
        GTFSFeed feed = GTFSFeed.fromFile(args[0]);
        feed.findPatterns();
        RouteStats stats = new RouteStats(feed);

        FileWriter writer = new FileWriter(new File(args[1]));

        writer.write("Route,AM Peak Frequency,Midday Frequency,PM Peak Frequency,Evening Frequency,AM Peak Speed,Midday Speed,PM Peak Speed,Evening Speed,Trips/Day,First trip,Last trip\n");

        for (String route_id : feed.routes.keySet()) {
            for (int direction_id : new int[] { 0, 1 }) {
                StringBuilder freq = new StringBuilder();
                StringBuilder speed = new StringBuilder();

                Route r = feed.routes.get(route_id);

                freq.append(r.route_short_name);
                freq.append(" ");
                freq.append(r.route_long_name);

                // guess at the direction name by finding longest pattern
                List<String> stops = feed.patterns.values().stream()
                        .filter(p -> p.route_id.equals(route_id) && feed.trips.get(p.associatedTrips.get(0)).direction_id == direction_id)<commit_msg>fix bad constructor<commit_after>package com.conveyal.gtfs;

import com.conveyal.gtfs.model.Route;
import com.conveyal.gtfs.model.Stop;
import com.conveyal.gtfs.stats.FeedStats;
import com.conveyal.gtfs.stats.RouteStats;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

/**
 * Summarize frequencies, designed for use in the KCMO transportation system.
 */
public class FrequencySummary {
    private static final LocalTime[] windows = new LocalTime[] {
            LocalTime.of(6, 0),
            LocalTime.of(9, 0),
            LocalTime.of(16, 0),
            LocalTime.of(18, 0),
            LocalTime.of(22, 0)
    };

    private static final LocalDate date = LocalDate.of(2016, 8, 30);

    public static void main(String... args) throws IOException {
        GTFSFeed feed = GTFSFeed.fromFile(args[0]);
        feed.findPatterns();
        FeedStats fs = new FeedStats(feed);
        RouteStats stats = new RouteStats(feed, fs);

        FileWriter writer = new FileWriter(new File(args[1]));

        writer.write("Route,AM Peak Frequency,Midday Frequency,PM Peak Frequency,Evening Frequency,AM Peak Speed,Midday Speed,PM Peak Speed,Evening Speed,Trips/Day,First trip,Last trip\n");

        for (String route_id : feed.routes.keySet()) {
            for (int direction_id : new int[] { 0, 1 }) {
                StringBuilder freq = new StringBuilder();
                StringBuilder speed = new StringBuilder();

                Route r = feed.routes.get(route_id);

                freq.append(r.route_short_name);
                freq.append(" ");
                freq.append(r.route_long_name);

                // guess at the direction name by finding longest pattern
                List<String> stops = feed.patterns.values().stream()
                        .filter(p -> p.route_id.equals(route_id) && feed.trips.get(p.associatedTrips.get(0)).direction_id == direction_id)
{'fraction_non_alphanumeric': 0.11289513296537883, 'fraction_numerical': 0.012543903662819869, 'mean_word_length': 2.6678932842686294, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7655538', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1135, 'n_words': 280}