You are not logged in.
EDIT: looking for anyone wishing to help me with translations (no programming knowledge required)
EDIT:
(v0.6+) now with timer mode:
Example use: Say you have fuzzytime piped to your status bar and it serves as a usual clock applet. Then you got an e-mail saying that you're going to have a meeting at one o'clock. You set the timer to 13:00 and instead of the current time, fuzzytime begins to show you how much time you have left till the meeting. After you come back, you unset the timer and have fuzzytime display the current time again.
Hello
The now-not-so-recent upgrade to Python 3 broke fuzzyclock which I liked a lot. Since my Python is next to non-existent, I decided to use the opportunity to dust off the little Haskell I knew, so here goes:
A clock and timer that tell the time in a more human way.
v0.7.6, 2011.12.30, *antispam*, GPL3+
fuzzytime [COMMAND] ... [OPTIONS]
Common flags:
-? --help Display help message
-V --version Print version information
fuzzytime clock [OPTIONS]
Print fuzzy time if timer is not set, and countdown if it is.
-a --caps=INT Capital letters; default 1 (see the man page).
-c --clock=INT 12 or 24-hour clock; default 12-hour.
-l --lang=ITEM Language (currently da, de, el, en, es, fr, it, ja, nb,
nl, pl, se and tr); default en.
-p --prec=INT Precision (1 <= prec <= 60 [minutes]); default 5.
-t --time=ITEM Time to fuzzify as HH:MM; default current time.
-o --sound=ITEM Command to play the alarm sound; see man for the default.
-s --style=INT How the time is told (see the man page); default 1.
fuzzytime timer [OPTIONS] [END]
Set timer to END as HH:MM or "unset". (Disables printing time.)
You can get the source from here. It requires runhaskell (e.g. ghc) and haskell-cmdargs. An AUR package is here. [edit: added aur link]
WARNING: it's not properly tested so if you're late for anything, don't blame me. You can tell me, though, and make me feel guilty if you like.
If you find any bugs, please let me know.
Currently, only two languages are supported: English and Polish. If you're willing to add another one or would just like to have another one but don't know how to or don't feel like doing it, please contact me.
Happy timing
EDIT:
v0.7.6 (2011.12.30)
-- added Japanese (by Jens Petersen)
v0.7.5 (2011.11.28)
-- added alarm sound config
v0.7.4 (2011.04.26)
-- added Italian (thanks erm67)
v0.7.3 (2011.04.22)
-- added Swedish (thanks Closey)
v0.7.2 (2011.04.17)
-- added --caps (0: all lowercase; 1: default; 2: Title Case; 3: ALL CAPS)
v0.7 (2011.01.24)
-- added Norwegian (thanks arnvidr)
-- added timer for Dutch (thanks Boris27) and German (thanks marens and ichbinsisyphos)
-- added Danish style 2
-- added German style 3 (thanks marens and ichbinsisyphos)
-- added Spanish style 3 (thanks xenofungus)
-- added timer alarm sound
-- fixed exit codes
v0.6 (2011.01.21)
-- added the timer mode (en, fr, pl and tr)
-- added Spanish (thanks itsbrad212)
-- fixed the almost-next-hour bug
v0.5 (2011.01.17)
-- added halves as base (de, nl and pl)
-- added Greek (thanks Gbak), Dutch (thanks litemotiv) and Turkish
-- some corrections (thanks D. Fischer from beginners@haskell.org again)
v0.4.1 (2011.01.15)
-- fixed nextFTHour
v0.4 (2011.01.15):
-- added --time (thanks D. Fischer and B. Yorgey from beginners@haskell.org)
-- added --style
-- added Danish (by M_ller with my modifications)
-- removed "południe" from pl
-- sorted out the representation of midnight and noon
-- added a man page
v0.3 (2011.01.14):
-- added midnight and noon
-- added checking cli options
-- fixed the "quarter part quarter" bug
v0.2 (2011.01.12):
-- added French and German
-- added 12 vs. 24-hour clock
Last edited by caminoix (2011-12-30 22:05:00)
Offline
The now-not-so-recent upgrade to Python 3 broke fuzzyclock
Ehmm... no it didn't. fuzzyclock works just fine with python2.
Nice work though.
Offline
Ehmm... no it didn't. fuzzyclock works just fine with python2.
Does it? Oops... Erm... Well... So there are two now
Offline
I wanted a fuzzy clock to show in conky so I knocked one up in C, I didn't know there was a python one (could've saved me some work)...
You're just jealous because the voices only talk to me.
Offline
Bump: looking for anyone wishing to help me with translations (no programming knowledge required).
Offline
Hey caminoix, thanks for a great utility!
Offline
I'm very happy that you like it
Have you managed to install it after all? I can see in aur that you had some problems?
Offline
I could help you out translating it to Danish if you want.
Offline
I could help you out translating it to Danish if you want.
Wonderful!
I suppose what I'm going to need is:
1. the desired casual "names" for the following hours: 23:30, 23:45, 00:00, 00:15, 11:30, 11:45, 12:00, 12:15, 22:00, 22:10, 22:15, 22:25, 22:30, 22:35, 22:45, unless there are any other "special" hours in Danish, i.e. ones that would not get properly rendered by an algorithm covering the above?
2. if possible, you to check the results once they are ready. Unfortunately, I do not know Danish and couldn't be sure when doing it myself.
Thank you for your help!
EDIT: I just realized that you might be actually wanting to implement it yourself. In such case just drop me a line whenever you're not sure why I did something the way I did, or want to bash me for my programming ignorance Unless you want to fork, I'll be very happy to incorporate your code if you agree.
Last edited by caminoix (2011-01-14 21:34:51)
Offline
M_ller wrote:I could help you out translating it to Danish if you want.
Wonderful!
I suppose what I'm going to need is:
1. the desired casual "names" for the following hours: 23:30, 23:45, 00:00, 00:15, 11:30, 11:45, 12:00, 12:15, 22:00, 22:10, 22:15, 22:25, 22:30, 22:35, 22:45, unless there are any other "special" hours in Danish, i.e. ones that would not get properly rendered by an algorithm covering the above?
2. if possible, you to check the results once they are ready. Unfortunately, I do not know Danish and couldn't be sure when doing it myself.
Thank you for your help!
EDIT: I just realized that you might be actually wanting to implement it yourself. In such case just drop me a line whenever you're not sure why I did something the way I did, or want to bash me for my programming ignorance Unless you want to fork, I'll be very happy to incorporate your code if you agree.
I have edited your source (fuzzytime.hs) and here is the result.
showFuzzyTimeDa :: FuzzyTime -> String
showFuzzyTimeDa (FuzzyTime am clock hour _ min)
| min == 0 = if (getHour hour) `elem` ["midnat", "aften"] then (getHour hour) else (getHour hour) ++ " klokken" -- We don't really use anything. You could remove " klokken"
| min <= 30 = getMin min ++ " over " ++ getHour hour
| min > 30 = getMin (60-min) ++ " i " ++ getHour (hour+1)
| otherwise = "Ups, det ser ud til den er " ++ show hour ++ ":" ++ show min ++ "."
where
getHour :: Int -> String
getHour h
| h == 0 && am = "midnat"
| h == 0 && not am = if clock==12 then "aften" else "midnat"
| h == 12 = "aften"
| otherwise = numeralDa h
getMin :: Int -> String
getMin m
| m == 30 = "halv" -- You should note that we don't say "half past 2" when it's 14:30. We say "It's half 3".
| m `elem` [15, 45] = "kvarter"
| otherwise = numeralDa m
numeralDa :: Int -> String
numeralDa n
| n < 20 = numeralDaHelper1 n
| n `mod` 10 == 0 = numeralDaHelper10 (n `div` 10)
| otherwise = numeralDaHelper10 (n `div` 10) ++ "-" ++ numeralEnHelper1 (n `mod` 10)
where
numeralDaHelper1 :: Int -> String
numeralDaHelper1 i = ["nul", "et", "to", "tre", "fire", "fem", "seks", "syv", "otte", "ni", "ti", "eleve", "tolv", "tretten", "fjorten", "femten", "seksten", "sytten", "atten", "nitten"] !! i
numeralDaHelper10 :: Int -> String
numeralDaHelper10 i = ["tyve", "tredive", "fyrre", "halvtreds"] !! (i-2)
23:30 - Halv tolv (perhaps fireogtyve instead of tolv)
23:45 - Kvart i tolv (perhaps fireogtyve instead of tolv)
00:00 - Tolv (perhaps fireogtyve instead of tolv)
00:15 - Kvart over tolv (perhaps fireogtyve instead of tolv)
11:30 - Halv tolv
11:45 - Kvart i tolv
12:00 - Tolv
12:15 - Kvart over tolv
22:00 - Toogtyve
22:10 - Ti over toogtyve
22:15 - Kvart over toogtyve
22:25 - Femogtyve over toogtyve
22:30 - Halv treogtyve
22:35 - Femogtyve i treogtyve
22:45 - Kvart i treogtyve
It's quite confusing 'cause we usually use "tolv" for both 12:00 and 24:00 (and eleve for 11:00 and 23:00 and so on), but to be correct, you should probably stick with tolv for 12 and fireogtyve for 24.
Last edited by M_ller (2011-01-14 21:41:22)
Offline
Wow, that was fast!
I've made a few modifications in the meantime, so I'll update your code and post it for testing.
Offline
I've uploaded a new version to AUR, ready for testing. There are quite a few changes but the two most notable ones are the addition of --time (makes testing much easier) and --style.
@M_ller
I've made some modifications to your code, mostly basing on your comments and the number of hits in Google for certain phrases. It would be great if you could take a look at it, please (see the script below), and tell me whether this matches how Danish people really speak in casual situations.
A testing script:
#!/bin/bash
function testMidnight {
for i in "23:30" "23:45" "00:00" "00:15" "11:30" "11:45" "12:00" "12:15"; do
echo $i" "`fuzzytime "$clock" "$lang" "$prec" -t$i "$style"`
done
}
lang="-lda"; prec="-p5";
echo "Style 1"
clock="-c12"; style="-s1"; testMidnight
echo
clock="-c24"; style="-s1"; testMidnight
echo
echo
echo "Style 2"
clock="-c12"; style="-s2"; testMidnight
echo
clock="-c24"; style="-s2"; testMidnight
Offline
I just installed it (damn that Haskell was a big package/install) and I will test it out at certain times.
It does work nicely at the moment ("tyve i tre" = twenty to three), so nice job.
It is nice with the feature of 12 or 24-hour clock, since, as I described before, we usually don't say the numbers above 12, even though it's nice (etc. 18, we say 6 (seks)).
I think it is working perfectly. When using the 12-hour clock, it is exactly like we would say.
Offline
Great to hear that, M_ller If you ever notice a problem, though, please drop me a line. Thanks for your work!
Offline
Dutch:
23:30 - Half twaalf
23:45 - Kwart voor twaalf
00:00 - Middernacht (all other use 'twaalf', whether it's noon or midnight)
00:15 - Kwart over twaalf
11:30 - Half twaalf
11:45 - Kwart voor twaalf
12:00 - Twaalf uur
12:15 - Kwart over twaalf
22:00 - Tien uur
22:10 - Tien over tien
22:20 - Twintig over tien
22:25 - Vijf voor half elf
22:35 - Vijf over half elf
22:40 - Tien over half elf (or, Twintig voor elf, first form preferred)
een / twee / drie / vier / vijf / zes / zeven / acht / negen / tien / elf / twaalf / 15: kwart / 20: twintig
ᶘ ᵒᴥᵒᶅ
Offline
23:30 - Εντεκάμιση or "Έντεκα και μισή"
23:45 - Δώδεκα παρά τέταρο
00:00 - Δώδεκα
00:15 - Δώδεκα και τέταρτο
11:30 - Εντεκάμιση or "Έντεκα και μισή"
11:45 - Δώδεκα παρά τέταρο
12:00 - Δώδεκα
12:15 - Δώδεκα και τέταρτο
22:00 - Δέκα
22:10 - Δέκα και δέκα
22:15 - Δέκα και τέταρτο
22:25 - Δέκα και είκοσιπέντε
22:30 - Δέκα και μισή
22:35 - Δέκα και τριανταπέντε
22:45 - Έντεκα παρά τέταρτο
Translated in Greek
Offline
Wonderful, thanks, guys! I'll try to do it in a reasonable time and I'll come back when I'm ready.
Offline
Uploaded a new version.
(Chronologically) M_ller, litemotiv and Gbak, can you please take a look? The actual outputs are one thing, but please also see the man page where I described some decisions I made basing on what you said and the number of hits in Google for certain phrases. I'd be grateful for a confirmation or corrections.
There's a new version of the testing script here.
Offline
I can do Spanish translations if you would like. Do you want something such as "it is twelve-thirty" or just "twelve-thirty"?
Offline
That is great, itsbrad212, thank you!
(The post looks long and complicated, but don't worry, it's not, it's just words, words, words
If that's possible, I'd like two versions: 1. a simple "ten past six", "ten to six", 2. a more elaborate one, using words like "midnight" and "noon", constructions like (literally) "five past half past six" and similar – obviously, only if such things are actually in common use.
Basically, the point is to obtain the kind of wording that you'd expect from a human if you asked him or her what time it is, in a slightly more "digital" and a slightly more human version. Pretty much what the guys above have done. So if you e.g. use the word for 'midnight' for telling the time but don't use 'noon', that's just fine.
If what I said is not clear, please take a look at the table in the man page. If that doesn't help, I'll try to explain it some other way.
Additionally, I'm considering adding a countdown timer to remind you when to stop boiling the eggs, leave for the meeting or something. For this, I'm going to need translations for the following phrases:
– in an hour + an hour ago
– in three quarters (if actually used) + three quarters ago
– in half an hour + half an hour ago
– in a minute + a minute ago
+
whatever comes to your mind and you think it would be useful, funny or desired in any other way.
Offline
23:30 - Son las once y media de la noche (It's eleven and a half in the evening)
23:45 - Es la medianoche menos quince (It's fifteen before midnight)
00:00 - Es la medianoche (It's midnight)
00:15 - Es la medianoche y cuarto (It's a quarter past midnight)
11:30 - Son las once y media de la mañana (It's eleven and a half in the morning)
11:45 - Son las mediodía menos quince (It's fifteen before noon)
12:00 - Son las mediodía (It's noon)
12:15 - Son las doce y cuarto de la tarde (It's twelve and a quarter in the afternoon)
22:00 - Son las diez de la noche (It's ten in the evening)
22:10 - Son las diez y diez de la noche (It's ten past ten in the evening)
22:15 - Son las diez y cuarto de la noche (It's a quarter past ten in the evening)
22:25 - Son las diez y veinticinco de la noche (It's ten twenty-five in the evening)
22:30 - Son las diez y media de la noche (It's ten and a half in the evening)
22:35 - Son las once menos veinticinco de la noche (It's twenty-five before eleven in the evening)
22:45 - Son las once menos quince de la noche (It's fifteen before eleven in the evening)
There you are. I may have mistyped a few things here or there, but it all looks correct to me.
Last edited by cesura (2011-01-18 23:41:04)
Offline
Great, thanks!
Offline
Version 0.6 is out.
I added Spanish, so itsbrad212, it will be great if you can take a look at it.
I also added a timer mode so besides showing the time, fuzzytime can now also remind you how much time you have left till something. More details in --help, in the man page and here.
Offline
23:30 - Son las once y media de la noche (It's eleven and a half in the evening)
23:45 - Es la medianoche menos quince (It's fifteen before midnight)
00:00 - Es la medianoche (It's midnight)
00:15 - Es la medianoche y cuarto (It's a quarter past midnight)
11:30 - Son las once y media de la mañana (It's eleven and a half in the morning)
11:45 - Son las mediodía menos quince (It's fifteen before noon)
12:00 - Son las mediodía (It's noon)
12:15 - Son las doce y cuarto de la tarde (It's twelve and a quarter in the afternoon)
22:00 - Son las diez de la noche (It's ten in the evening)
22:10 - Son las diez y diez de la noche (It's ten past ten in the evening)
22:15 - Son las diez y cuarto de la noche (It's a quarter past ten in the evening)
22:25 - Son las diez y veinticinco de la noche (It's ten twenty-five in the evening)
22:30 - Son las diez y media de la noche (It's ten and a half in the evening)
22:35 - Son las once menos veinticinco de la noche (It's twenty-five before eleven in the evening)
22:45 - Son las once menos quince de la noche (It's fifteen before eleven in the evening)There you are. I may have mistyped a few things here or there, but it all looks correct to me.
Don't know about south-central-american spanish, but in spanish from spain this sounds more natural:
23:30 - Son las once y media de la noche.
23:45 - Son las doce menos cuarto de la noche.
00:00 - Es medianoche.
00:15 - Son las doce y cuarto de la noche.
11:30 - Son las once y media de la mañana.
11:45 - Son doce menos cuarto de la mañana.
12:00 - Es mediodía.
12:15 - Son las doce y cuarto de la tarde.
22:00 - Son las diez de la noche.
22:10 - Son las diez y diez de la noche.
22:15 - Son las diez y cuarto de la noche.
22:25 - Son las diez y veinticinco de la noche.
22:30 - Son las diez y media de la noche.
22:35 - Son las once menos veinticinco de la noche.
22:45 - Son las once menos cuarto de la noche.
01:15 - Es la una y cuarto de la mañana.
13:30 - Es la una y media de la tarde.
Offline
@xenofungus
Thank you for the translation! As far as the differences between Spanish in Spain and in the Americas are concerned, well, all I can do is to believe native speakers. In fact, I'm from Europe, so I guess I have a bias for the Spanish Spanish anyway but I can see no reason why there shouldn't be two or more separate "Spanishes" available. I just need exact information.
From what you wrote, I can see the difference is mainly in the use of medianoche and medodía. If you can, please install fuzzytime and tell me whether what it produces sounds wrong to you (you can specify the time with -tHH:MM, and there are some differences between -s1 (default) and -s2).
Also, is the es/son and de la mañana/tarde/noche really used in a casual conversation? If you asked a friend what time it is, would you expect to hear either of these?
Offline