<commit_before>//
//  LYRConversationQueryDataSource.h
//  LayerUIKit
//
//  Created by <NAME> on 2/4/15.
//
//

#import <UIKit/UIKit.h> 
#import <LayerKit/LayerKit.h>

extern NSInteger const LYRUINumberOfSectionsBeforeFirstMessageSection;

/**
 @abstract The `LYRUIConversationDataSource` manages an `LYRQueryController` object whose data is displayed in an
 `LYRUIConversationViewController`. The `LYRUIConversationDataSource` also provides convenience methods for the transalation 
 of index objects between an `LYRQueryController` and an `LYRUIConversationViewController`.
 @discussion The `LYRUIConversationViewController` reserves the section at index 0 for a "Loading Messages" indicator if
 one is needed during pagination. The index translation methods provided by the `LYRUIConversationDataSource` account for
 this offset.
 */
@interface LYRUIConversationDataSource : NSObject

///---------------------------------------
/// @name Designated Initializer
///---------------------------------------

/**
 @abstract Creates and returns an `LYRUIConversationDataSource` object.
 @param layerClient An `LYRClient` object used to initialize the `queryController` property.
 @param conversation An `LYRConversation` object used in the predicate of the `queryController` property's `LYRQuery`.
 @return An `LYRUIConversationDataSource` object.
 */
+ (instancetype)dataSourceWithLayerClient:(LYRClient *)layerClient conversation:(LYRConversation *)conversation;

/*
 @abstract The `LYRQueryController` object managing data displayed in the `LYRUIConversationViewController`.
 @disucssion The `queryController` is hydrated with messages belonging to the `LYRConversation` object
 supplied in the designated initializer.
 */
@property (nonatomic, readonly) LYRQueryController *queryController;

///---------------------------------------
/// @name Pagination
///---------------------------------------

/*
 @abstracts Asks the receiver if its `queryController` has more messages to display than are currently displayed on screen.
 @return `YES` if there are more messages to display.
 */
- (BOOL)moreMessagesAvailable;

/*
 @abstract Increments the pagination window of the `queryController` by the `paginationWindow` property if
 more messages are available for display.
 */
- (void)expandPaginationWindow;

/*
 @abstract Returns yes if the data source is currently in the process of expanding its pagination window.
 */
@property (nonatomic, readonly, getter=isExpandingPaginationWindow) BOOL expandingPaginationWindow;

///---------------------------------------
/// @name Index Translation Methods
///---------------------------------------

/*
 @abstract Converts an `LYRUIConversationViewController` index path into an `LYRQueryController` index path.
 */
- (NSIndexPath *)queryControllerIndexPathForCollectionViewIndexPath:(NSIndexPath *)collectionViewIndexPath;
<commit_msg>Adding back ticks to yes<commit_after>//
//  LYRConversationQueryDataSource.h
//  LayerUIKit
//
//  Created by <NAME> on 2/4/15.
//
//

#import <UIKit/UIKit.h> 
#import <LayerKit/LayerKit.h>

extern NSInteger const LYRUINumberOfSectionsBeforeFirstMessageSection;

/**
 @abstract The `LYRUIConversationDataSource` manages an `LYRQueryController` object whose data is displayed in an
 `LYRUIConversationViewController`. The `LYRUIConversationDataSource` also provides convenience methods for the transalation 
 of index objects between an `LYRQueryController` and an `LYRUIConversationViewController`.
 @discussion The `LYRUIConversationViewController` reserves the section at index 0 for a "Loading Messages" indicator if
 one is needed during pagination. The index translation methods provided by the `LYRUIConversationDataSource` account for
 this offset.
 */
@interface LYRUIConversationDataSource : NSObject

///---------------------------------------
/// @name Designated Initializer
///---------------------------------------

/**
 @abstract Creates and returns an `LYRUIConversationDataSource` object.
 @param layerClient An `LYRClient` object used to initialize the `queryController` property.
 @param conversation An `LYRConversation` object used in the predicate of the `queryController` property's `LYRQuery`.
 @return An `LYRUIConversationDataSource` object.
 */
+ (instancetype)dataSourceWithLayerClient:(LYRClient *)layerClient conversation:(LYRConversation *)conversation;

/*
 @abstract The `LYRQueryController` object managing data displayed in the `LYRUIConversationViewController`.
 @disucssion The `queryController` is hydrated with messages belonging to the `LYRConversation` object
 supplied in the designated initializer.
 */
@property (nonatomic, readonly) LYRQueryController *queryController;

///---------------------------------------
/// @name Pagination
///---------------------------------------

/*
 @abstracts Asks the receiver if its `queryController` has more messages to display than are currently displayed on screen.
 @return `YES` if there are more messages to display.
 */
- (BOOL)moreMessagesAvailable;

/*
 @abstract Increments the pagination window of the `queryController` by the `paginationWindow` property if
 more messages are available for display.
 */
- (void)expandPaginationWindow;

/*
 @abstract Returns `yes` if the data source is currently in the process of expanding its pagination window.
 */
@property (nonatomic, readonly, getter=isExpandingPaginationWindow) BOOL expandingPaginationWindow;

///---------------------------------------
/// @name Index Translation Methods
///---------------------------------------

/*
 @abstract Converts an `LYRUIConversationViewController` index path into an `LYRQueryController` index path.
 */
- (NSIndexPath *)queryControllerIndexPathForCollectionViewIndexPath:(NSIndexPath *)collectionViewIndexPath;

{'fraction_non_alphanumeric': 0.1571750043275056, 'fraction_numerical': 0.0017310022503029255, 'mean_word_length': 3.4895104895104896, 'pattern_counts': {'":': 0, '<': 9, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5095290', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1388, 'n_words': 502}