private static string GetYatiRules(object[][] Rules, int[][] Yati, YatiMode Mode, bool ReverseYati) { string s = ""; if (Yati.Length == Rules.Length && Yati.Length > 1) { for (int i = 0; i < Yati.Length; i++) { int[] LineRule = Yati[i]; if (Yati.Length > 1) { if (i == 0) { s = s + "<ol class='rules'>"; } s = s + "<li><nobr>"; } if (LineRule.Length > 0) { s = s + GetPadamYatiText2(LineRule); } else { s = s + "--"; } if (LineRule.Length > 0) { s = s + _YEnd(Mode, ReverseYati, LineRule.Length); } if (Yati.Length > 1) { s = s + "</nobr></li>"; if (i == Yati.Length - 1) { s = s + "</ol>"; } } } } else { if (Yati.Length > 0 && Yati[0].Length > 0) { int[] LineRule = Yati[0]; s = s + GetPadamYatiText2(LineRule); s = s + _YEnd(Mode, ReverseYati, LineRule.Length); } } return(s); }
internal string CSYatiMode(YatiMode yatiMode) { switch (yatiMode) { case YatiMode.CharPosition: return("YatiMode.CharPosition"); case YatiMode.GPosition: return("YatiMode.GPosition"); } return(""); }
private static string GetPadamYatiText(int[] LineRule, YatiMode _YatiMode, bool ReverseYati) { if (LineRule.Length == 0) { return(""); } string s = "<span class='gName'>"; for (int i = 0; i < LineRule.Length; i++) { int o = LineRule[i]; s = s + o.ToString( ); if (i != LineRule.Length - 1) { s = s + ","; } } if (_YatiMode == YatiMode.GPosition) { if (ReverseYati) { s = s + (LineRule.Length > 1 ? "</span> గణముల చివరి అక్షరములు" : "</span> వ గణము యొక్క చివరి అక్షరము"); } else { s = s + (LineRule.Length > 1 ? "</span> గణముల మొదటి అక్షరములు" : "</span> వ గణము యొక్క మొదటి అక్షరము"); } } if (_YatiMode == YatiMode.CharPosition) { s = s + (LineRule.Length > 1 ? "</span> వ అక్షరములు" : "</span> వ అక్షరము"); } return(s); }
private static string _YEnd(YatiMode Mode, bool ReverseYati, int Length) { string s = ""; if (Mode == YatiMode.GPosition) { if (ReverseYati) { s = s + (Length > 1 ? " గణముల చివరి అక్షరములు" : " వ గణము యొక్క చివరి అక్షరము"); } else { s = s + (Length > 1 ? " గణముల మొదటి అక్షరములు" : " వ గణము యొక్క మొదటి అక్షరము"); } } if (Mode == YatiMode.CharPosition) { s = s + (Length > 1 ? " వ అక్షరములు" : " వ అక్షరము"); } return(s); }
private int FindNextYati(int[][] YYY, YatiMode yatiMode, bool recycle, int localG) { int next = 0; if (YYY.Length > 1 || YYY.Length == 0) { return(0); } int[] YY = YYY[0]; foreach (int y in YY) { if (yatiMode == YatiMode.CharPosition) { //Assuming threshold as 3 for all..and YY is ascendeing.. int afterGan = (int)Math.Floor(y / 3.0); int pos = y % 3; if (afterGan + 1 < localG) { continue; } if (afterGan + 1 > next) { if (pos == 0) { temp = 2; //?? return(afterGan); } else { temp = pos - 1; return(afterGan + 1); } } } } return(next); }
private string AddEnum(string name, YatiMode val) { return(name + ":" + (int)val + ","); }