Skip to content

Commit

Permalink
remove redundant dash
Browse files Browse the repository at this point in the history
  • Loading branch information
qdinar committed Jan 22, 2014
1 parent 31a3ea0 commit 60868d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions function_order_2.php
Expand Up @@ -407,6 +407,7 @@ function order_2($inparr){
}
//inparr is without subject now
if(isset($inparr[count($inparr)-1][1]['w'])&&$inparr[count($inparr)-1][1]['w']=='and'&&$inparr[count($inparr)-1][0][1]['w']=='s'){
//and block (should be and) is put in inparr element
//need to remove 'and' block
$andblock=array_splice($inparr,-1);
order_2_if_needed($inparr);
Expand Down
20 changes: 16 additions & 4 deletions index2-2.php
Expand Up @@ -52,16 +52,28 @@ function nstd_to_str_2($nstd){
}
if(isset($nstd[0][1]['w'])){
if($nstd[0][1]['w']=='()'){
//swap
$parentheses=$nstd[0];
$nstd[0]=$nstd[1];
$nstd[1]=$parentheses;
}elseif($nstd[0][1]['w']=='һәм'){
$and=$nstd[0];
$nstd[0]=$nstd[1];
$nstd[1]=$and;
$and=$nstd[0];//and's block
$nstd[0]=$nstd[1];//main block
$nstd[1]=$and;//swap
$and=$nstd[1][1];
//swapping the word 'and' with dependent block
$nstd[1][1]=$nstd[1][0];
$nstd[1][0]=$and;
if(
isset($nstd[1][1]['dash'])//possible dash of external and block , that is positioned later
//&&isset($nstd[0][0][1]['w'])//possible 'and' of inner and block
//&&$nstd[0][0][1]['w']=='and'
//&&isset($nstd[0][0][0]['dash'])
&&isset($nstd[0]['dash'])
){
//echo'*';
unset($nstd[1][1]['dash']);//remove later dash
}
//}elseif($nstd[0][1]['w']==',,'){
}
}
Expand Down Expand Up @@ -628,7 +640,7 @@ function is_soft($s){
//i should fix:
//тизлеке -> тизлеге - done
//2007 таналып -> 2007дән алып - done

//i should make one dash instead of two - done



Expand Down

0 comments on commit 60868d9

Please sign in to comment.