Skip to content

Implemented 4/28 reviewer comments. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions buildLanguageDatabase.pl
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,16 @@ ()
my @numberRow = split($de,$page[$languageNumRow]);
my @idRow = split($de,$page[$languageIdRow]);
my @nameRow = split($de,$page[$languageNameRow]);
$tempReturn .= "INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES\n";
for (my $i = $constantColumn; $i < @numberRow; $i++) {
$tempReturn .= "INSERT INTO `lang_languages` VALUES (".$numberRow[$i].", '".$idRow[$i]."', '".$nameRow[$i]."');\n";
$tempReturn .= "(".$numberRow[$i].", '".$idRow[$i]."', '".$nameRow[$i]."'),\n";
$tempCounter = $numberRow[$i];

# set up for statistics later
push (@languages, $nameRow[$i]);
$numberConstantsLanguages[$numberRow[$i]-1] = 0;
}
$tempReturn =~ s/,\n$/;\n/;
$tempCounter += 1;

# create header
Expand Down Expand Up @@ -450,13 +452,15 @@ ()
# create table input
my $tempReturn;
my $tempCounter;
$tempReturn .= "INSERT INTO `lang_constants` (`cons_id`, `constant_name`) VALUES\n";
for (my $i = $constantRow; $i < @page; $i++) {
my @tempRow = split($de,$page[$i]);
my $tempId = $tempRow[$constantIdColumn];
my $tempConstant = $tempRow[$constantColumn];
$tempReturn .= "INSERT INTO `lang_constants` VALUES (".$tempId.", '".$tempConstant."');\n";
$tempReturn .= "(".$tempId.", '".$tempConstant."'),\n";
$tempCounter = $tempId;
}
$tempReturn =~ s/,\n$/;\n/;
$tempCounter += 1;

# create header
Expand Down Expand Up @@ -514,22 +518,24 @@ ()
my $tempCounter;
my @numberRow = split($de,$page[$languageNumRow]);
my $counter = 1;
$tempReturn .= "INSERT INTO `lang_definitions` (`def_id`, `cons_id`, `lang_id`, `definition`) VALUES\n";
for (my $i = $constantColumn + 1; $i < @numberRow; $i++) {
for (my $j = $constantRow; $j < @page; $j++) {
my @tempRow = split($de,$page[$j]);
my $tempId = $tempRow[$constantIdColumn];
my $tempDefinition = $tempRow[$i];
my $tempLangNumber = $numberRow[$i];
if ($tempDefinition !~ /^\s*$/) {
$tempReturn .= "INSERT INTO `lang_definitions` VALUES (".$counter.", ".$tempId.", ".$tempLangNumber.", '".$tempDefinition."');\n";
$tempReturn .= "(".$counter.", ".$tempId.", ".$tempLangNumber.", '".$tempDefinition."'),\n";
$tempCounter = $counter;
$counter += 1;

# set up for statistics
$numberConstantsLanguages[($tempLangNumber - 1)] += 1;
}
}
}
$tempReturn =~ s/,\n$/;\n/;
$tempCounter += 1;

# create header
Expand Down