Advertisement
Advertisement
| 05.22.2008 at 03:33PM PDT, ID: 23426127 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: |
#!/usr/bin/perl -w
use strict;
use utf8;
use XML::Simple;
use LWP::Simple;
use Encode;
sub main {
my $ref = XMLin("language_propertiesALL.xml");
my $longestString = "";
my $currentString = "";
my $currentLongestLang = "";
open myFile, "allPropertyNames.txt";
while(chomp(my $line = <myFile>)) {
open myGroupsFile, "groups.txt";
while(chomp(my $groupsline = <myGroupsFile>)) {
if( exists $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'en'}->{'content'})
{
$currentString = $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'en'}->{'content'};
if(length($currentString) > length($longestString))
{
$longestString = $currentString;
$currentLongestLang = "en";
}
}
if( exists $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'ro'}->{'content'})
{
print "bla";
$currentString = $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'ro'}->{'content'};
if(length($currentString) > length($longestString))
{
$longestString = $currentString;
$currentLongestLang = "ro";
}
}
if( exists $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'es'}->{'content'})
{
print "bla";
$currentString = $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'es'}->{'content'};
if(length($currentString) > length($longestString))
{
$longestString = $currentString;
$currentLongestLang = "es";
}
}
if( exists $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'cs'}->{'content'})
{
print "bla";
$currentString = $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'cs'}->{'content'};
if(length($currentString) > length($longestString))
{
$longestString = $currentString;
$currentLongestLang = "cs";
}
}
if( exists $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'el'}->{'content'})
{
print "bla";
$currentString = $ref->{'configuration'}->{'all'}->{'properties'}[0]->{'languageproperty'}->{$line}->{'group'}->{$groupsline}->{'languagecode'}->{'el'}->{'content'};
if(length(decode_utf8($currentString)) > length($longestString))
{
$longestString = $currentString;
$currentLongestLang = "el";
}
}
}
close(myGroupsFile);
if( not $longestString eq "")
{
print "$line";
print "~";
print "$currentLongestLang";
print "~";
print "$longestString";
print "\n";
}
}
close(myFile);
}
main();
|