<commit_before>/*
 *  NJISO8601Formatter.h
 *  NJISO8601
 *
 *  Created by han9kin on 2012-03-21.
 *  Copyright (c) 2012 NHN. All rights reserved.
 *
 */

#import <Foundation/Foundation.h>


/*
 * NSFormatter for ISO 8601:2004
 *
 * Reference: http://dotat.at/tmp/ISO_8601-2004_E.pdf
 *
 *
 * Supported Formats
 *
 * - Calendar Date
 * - Ordinal Date
 * - Week Date
 * - Local Time with Decimal Fractions
 * - Midnight
 * - Time Zone
 *
 * Unsupported Formats
 *
 * - BC Date (CoreFoundation's Gregorian APIs cannot handle years less then zero)
 * - Basic Format of Ordinal Date Expanded Representation (Year > 9999)
 * - Local Time with Leap Second (Second >= 60.0)
 * - Time Inverval
 * - Duration
 * - Recurring Time Interval
 *
 */


typedef enum
{
    NJISO8601FormatterDateStyleCalendarExtended = 0,    /* Default  (YYYY-MM-DD) */
    NJISO8601FormatterDateStyleCalendarBasic,           /*          (YYYYMMDD)   */
    NJISO8601FormatterDateStyleOrdinalExtended,         /*          (YYYY-DDD)   */
    NJISO8601FormatterDateStyleOrdinalBasic,            /*          (YYYYDDD)    */
    NJISO8601FormatterDateStyleWeekExtended,            /*          (YYYY-Www-D) */
    NJISO8601FormatterDateStyleWeekBasic,               /*          (YYYYWwwD)   */
} NJISO8601FormatterDateStyle;


typedef enum
{
    NJISO8601FormatterTimeStyleExtended = 0,            /* Default  (hh:mm:ss)   */
    NJISO8601FormatterTimeStyleBasic,                   /*          (hhmmss)     */
    NJISO8601FormatterTimeStyleNone,
} NJISO8601FormatterTimeStyle;


typedef enum
{
    NJISO8601FormatterTimeZoneStyleUTC = 0,             /* Default  (Z)          */
    NJISO8601FormatterTimeZoneStyleExtended,            /*          (±hh:mm)     */
    NJISO8601FormatterTimeZoneStyleBasic,               /*          (±hhmm)      */
    NJISO8601FormatterTimeZoneStyleNone,
} NJISO8601FormatterTimeZoneStyle;


typedef enum
{
    NJISO8601FormatterFractionSeparatorComma = 0,       /* Default  (,)          */
    NJISO8601FormatterFractionSeparatorDot,             /* Default  (.)          */
} NJISO8601FormatterFractionSeparator;


NSDate *NJISO8601DateFromString(NSString *aString);


@interface NJISO8601Formatter : NSFormatter


@property(nonatomic, assign) NJISO8601FormatterDateStyle          dateStyle;
@property(nonatomic, assign) NJISO8601FormatterTimeStyle          timeStyle;
@property(nonatomic, assign) NJISO8601FormatterTimeZoneStyle      timeZoneStyle;
@property(nonatomic, assign) NJISO8601FormatterFractionSeparator  fractionSeparator;
@property(nonatomic, assign) int                                  fractionDigits;
@property(nonatomic, retain) NSTimeZone                          *timeZone;


- (NSDate *)dateFromString:(NSString *)aString;
- (NSString *)stringFromDate:(NSDate *)aDate;


@end
<commit_msg>fix comment<commit_after>/*
 *  NJISO8601Formatter.h
 *  NJISO8601
 *
 *  Created by han9kin on 2012-03-21.
 *  Copyright (c) 2012 NHN. All rights reserved.
 *
 */

#import <Foundation/Foundation.h>


/*
 * NSFormatter for ISO 8601:2004
 *
 * Reference: http://dotat.at/tmp/ISO_8601-2004_E.pdf
 *
 *
 * Supported Formats
 *
 * - Calendar Date
 * - Ordinal Date
 * - Week Date
 * - Local Time with Decimal Fractions
 * - Midnight
 * - Time Zone
 *
 * Unsupported Formats
 *
 * - BC Date (CoreFoundation's Gregorian APIs cannot handle years less then zero)
 * - Basic Format of Ordinal Date Expanded Representation (Year > 9999)
 * - Local Time with Leap Second (Second >= 60.0)
 * - Time Inverval
 * - Duration
 * - Recurring Time Interval
 *
 */


typedef enum
{
    NJISO8601FormatterDateStyleCalendarExtended = 0,    /* Default  (YYYY-MM-DD) */
    NJISO8601FormatterDateStyleCalendarBasic,           /*          (YYYYMMDD)   */
    NJISO8601FormatterDateStyleOrdinalExtended,         /*          (YYYY-DDD)   */
    NJISO8601FormatterDateStyleOrdinalBasic,            /*          (YYYYDDD)    */
    NJISO8601FormatterDateStyleWeekExtended,            /*          (YYYY-Www-D) */
    NJISO8601FormatterDateStyleWeekBasic,               /*          (YYYYWwwD)   */
} NJISO8601FormatterDateStyle;


typedef enum
{
    NJISO8601FormatterTimeStyleExtended = 0,            /* Default  (hh:mm:ss)   */
    NJISO8601FormatterTimeStyleBasic,                   /*          (hhmmss)     */
    NJISO8601FormatterTimeStyleNone,
} NJISO8601FormatterTimeStyle;


typedef enum
{
    NJISO8601FormatterTimeZoneStyleUTC = 0,             /* Default  (Z)          */
    NJISO8601FormatterTimeZoneStyleExtended,            /*          (±hh:mm)     */
    NJISO8601FormatterTimeZoneStyleBasic,               /*          (±hhmm)      */
    NJISO8601FormatterTimeZoneStyleNone,
} NJISO8601FormatterTimeZoneStyle;


typedef enum
{
    NJISO8601FormatterFractionSeparatorComma = 0,       /* Default  (,)          */
    NJISO8601FormatterFractionSeparatorDot,             /*          (.)          */
} NJISO8601FormatterFractionSeparator;


NSDate *NJISO8601DateFromString(NSString *aString);


@interface NJISO8601Formatter : NSFormatter


@property(nonatomic, assign) NJISO8601FormatterDateStyle          dateStyle;
@property(nonatomic, assign) NJISO8601FormatterTimeStyle          timeStyle;
@property(nonatomic, assign) NJISO8601FormatterTimeZoneStyle      timeZoneStyle;
@property(nonatomic, assign) NJISO8601FormatterFractionSeparator  fractionSeparator;
@property(nonatomic, assign) int                                  fractionDigits;
@property(nonatomic, retain) NSTimeZone                          *timeZone;


- (NSDate *)dateFromString:(NSString *)aString;
- (NSString *)stringFromDate:(NSDate *)aDate;


@end

{'fraction_non_alphanumeric': 0.09415121255349501, 'fraction_numerical': 0.052781740370898715, 'mean_word_length': 2.574888463989802, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2464352', 'n_tokens_mistral': 1953, 'n_tokens_neox': 1692, 'n_words': 318}