On Mon, Apr 6, 2015 at 12:18 AM, Offray Vladimir Luna Cárdenas <
[email protected]> wrote:

> Hi all,
>
> I'm making a small data scrapper[1] in pharo to feed some visualizations.
> The data I'm scrapping contains strings with dates in Spanish like '16:21 -
> 15 de jun. de 2011' and I would like to convert them to proper dates in
> Smalltalk. So I started prototyping an Small script at [2], but the problem
> is that monthIndex at: month doesn't work because 'jun' is not in the
> dictionary (please refer to [2] for details). This is motivated by month =
> 'jun' giving false, but when I inspect month its content is 'jun', so I
> think that I'm missing something important.
>
> [1] http://smalltalkhub.com/#!/~Offray/Dataviz
> [2] http://ws.stfx.eu/IOMTYZ0N9W29
>
> So here come my questions:
>
> a). How to get "monthIndex at: month" working properly so I can get '06'
> as the proper month index for the month 'jun' (junio).?
> b) Why month = 'jun' gives false?
> c) There is any way to convert strings which has months in different
> languages (for example Spanish) more directly?
>
>
>
I don't know the answer, but here is how you might work it out yourself
(its what I just did).
1. World > Tools > Find > Source.
2. Search for text: june
3. Excluding XxxTest test classes, class comments, and a dropList, only a
single method "initialize" looks relevant. That should make it easier.
4. In that method, right-click on 'MonthNames' > Extended search... >
References.
5. In each of those references put a "self haltOnce"
6. World > System > Enable halt/inspect once.
7. Evaluate your expression and see if you hit the halt.

So "maybe" you just edit that initialize method, then evaluate the comment
at the top of the method.

cheers -ben

Reply via email to