95 lines
6.1 KiB
Objective-C
95 lines
6.1 KiB
Objective-C
//
|
|
// Tense.m
|
|
// Espagram
|
|
//
|
|
// Created by Abel Fokkinga on 11/8/12.
|
|
// Copyright (c) 2012 Abel Fokkinga. All rights reserved.
|
|
//
|
|
|
|
#import "Tense.h"
|
|
|
|
@interface Tense()
|
|
@property (nonatomic, strong) NSDictionary * text;
|
|
@end
|
|
|
|
@implementation Tense
|
|
|
|
@synthesize tense = _tense;
|
|
@synthesize text = _text;
|
|
|
|
- (void) tense:(NSString *)t {
|
|
if ( ![t isEqualToString:_tense]){
|
|
_tense = t;
|
|
// reset dictionary
|
|
NSLog(@"Resetting tense");
|
|
self.text = nil;
|
|
}
|
|
}
|
|
|
|
- (NSDictionary *) text {
|
|
if ( !_text) {
|
|
if ( [self.tense isEqualToString:@"SIMPLE_PRESENT"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Presente de Indicativo",@"Simple present",@"Tegenwoordige tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"PRESENT_SUBJUNCTIVE"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Presente de Subjuntivo",@"Present subjunctive",@"Aanvoegende wijs",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"SIMPLE_PAST"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Pretérito Indefinido",@"Simple past",@"Verleden tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"IMPERFECT"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Imperfecto",@"Imperfect",@"Onvoltooid verleden tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"IMPERFECT_SUBJUNCTIVE"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Imperfecto de Subjuntivo",@"Imperfect subjunctive",@"Onvoltooid aanvoegende wijs",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
|
|
if ( [self.tense isEqualToString:@"FUTURE"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Futuro",@"Future",@"Toekomstige tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"PRESENT_PERFECT"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Pretérito Perfecto",@"Present perfect",@"Voltooid tegenwoordige tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"PERFECT_SUBJUNCTIVE"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Perfecto de Subjuntivo",@"Present perfect subjunctive",@"Voltooid aanvoegende wijs",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
|
|
if ( [self.tense isEqualToString:@"PAST_PERFECT"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Pluscuamperfecto",@"Past perfect",@"Voltooid verleden tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
|
|
if ( [self.tense isEqualToString:@"PAST_PERFECT_SUBJUNCTIVE"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Pluscuamperfecto Subjuntivo",@"Past perfect subjunctive",@"Voltooid verleden aanvoegende wijs",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
|
|
if ( [self.tense isEqualToString:@"FUTURE_PERFECT"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Futuro perfecto",@"Future perfect",@"Voltooid tegenwoordige toekomende tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"CONDITIONAL"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Condicional",@"Conditional",@"Onvoltooid verleden toekomende tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
|
|
if ( [self.tense isEqualToString:@"CONDITIONAL_PERFECT"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Condicional Perfecto",@"Conditional Perfect",@"Voltooid verleden toekomende tijd",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
|
|
if ( [self.tense isEqualToString:@"GERUND"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Gerundio",@"Gerund",@"Tegenwoordig deelwoord",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
if ( [self.tense isEqualToString:@"IMPERATIVE"])
|
|
_text = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]
|
|
initWithObjects:@"Imperativo",@"Imperative",@"Gebiedende wijs",nil] forKeys:[[NSArray alloc] initWithObjects:@"Spanish",@"English",@"Dutch", nil]];
|
|
}
|
|
|
|
return _text;
|
|
}
|
|
|
|
- (NSString *) getTenseInLanguage:(NSString *)language {
|
|
return [self.text objectForKey:language];
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|