<commit_before>////////////////////////////////////////////////////////////////////////////////
// Comments

// Solution to ex. 1-13.

// This is the horizontal histogram.

////////////////////////////////////////////////////////////////////////////////
// Libraries

#include <stdio.h>

////////////////////////////////////////////////////////////////////////////////
// Symbolic Constants

#define IN 1 // IN a word
#define OUT 0 // OUT of a word
#define MAXC 21 // Max number of Characters in a word
#define MAXW 60 // Max histogram Width

////////////////////////////////////////////////////////////////////////////////
int main()
{
	int c, e, ee, high, wc, state;
	int length[ MAXC ];

	/* Word count */
	for( e = 0; e < MAXC; ++e )
	{
		length[ e ] = 0;
	}
	wc = high = 0;
	state = OUT;

	while( ( c = getchar() ) != EOF )
	{
		if( state == IN && ( c == '\t' || c == '\n' || c == ' ' ) )
		{
			if( wc < MAXC - 1 )
			{
				if( ++length[ wc ] > high )
				{
					high = length[ wc ];
				}
			}
			else
			{
				if( ++length[ MAXC - 1 ] > high )
				{
					high = length[ MAXC - 1 ];
				}
			}

			wc = 0;
			state = OUT;
		}
		else if(  c != '\t' && c != '\n' && c != ' ' )
		{
			++wc;
			if( state == OUT )
			{
				state = IN;
			}
		}
	}

	/* Print histogram */
	for( e = 1; e < MAXC; ++e )
	{
		if( e < MAXC - 1 )
		{
			printf( "%4d  ", e );
		}
		else
		{
			printf( "  19+ " );
		}
		for( ee = 0; ee < ( int )( ( length[ e ] * ( MAXW / ( float )high ) ) + 0.99 ); ++ee )
		{
			putchar( '|' );
		}
		putchar( '\n' );<commit_msg>19+ -> 20+ (more senible)<commit_after>////////////////////////////////////////////////////////////////////////////////
// Comments

// Solution to ex. 1-13.

// This is the horizontal histogram.

////////////////////////////////////////////////////////////////////////////////
// Libraries

#include <stdio.h>

////////////////////////////////////////////////////////////////////////////////
// Symbolic Constants

#define IN 1 // IN a word
#define OUT 0 // OUT of a word
#define MAXC 21 // Max number of Characters in a word
#define MAXW 60 // Max histogram Width

////////////////////////////////////////////////////////////////////////////////
int main()
{
	int c, e, ee, high, wc, state;
	int length[ MAXC ];

	/* Word count */
	for( e = 0; e < MAXC; ++e )
	{
		length[ e ] = 0;
	}
	wc = high = 0;
	state = OUT;

	while( ( c = getchar() ) != EOF )
	{
		if( state == IN && ( c == '\t' || c == '\n' || c == ' ' ) )
		{
			if( wc < MAXC - 1 )
			{
				if( ++length[ wc ] > high )
				{
					high = length[ wc ];
				}
			}
			else
			{
				if( ++length[ MAXC - 1 ] > high )
				{
					high = length[ MAXC - 1 ];
				}
			}

			wc = 0;
			state = OUT;
		}
		else if(  c != '\t' && c != '\n' && c != ' ' )
		{
			++wc;
			if( state == OUT )
			{
				state = IN;
			}
		}
	}

	/* Print histogram */
	for( e = 1; e < MAXC; ++e )
	{
		if( e < MAXC - 1 )
		{
			printf( "%4d  ", e );
		}
		else
		{
			printf( "  20+ " );
		}
		for( ee = 0; ee < ( int )( ( length[ e ] * ( MAXW / ( float )high ) ) + 0.99 ); ++ee )
		{
			putchar( '|' );
		}
		putchar( '\n' );
{'fraction_non_alphanumeric': 0.3709677419354839, 'fraction_numerical': 0.017419354838709676, 'mean_word_length': 0.97264631043257, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 10, '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': '4701188', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1068, 'n_words': 315}