Rosetta Code/Rank languages by popularity: Difference between revisions
Rosetta Code/Rank languages by popularity (view source)
Revision as of 15:37, 3 June 2024
, 26 days ago→{{header|Ada}}
(Updated for changes in the MediaWiki API and the JDK) |
JoseAlexis (talk | contribs) |
||
Line 43:
with Ada.Containers.Ordered_Sets;
with Ada.Strings.Unbounded.Less_Case_Insensitive;
with Ada.Characters.Handling; use Ada.Characters.Handling;
Line 59:
type A_Language_Count is
record
Count :
Language : Unbounded_String;
end record;
function "=" (L, R : A_Language_Count) return Boolean is
begin
Line 75 ⟶ 74:
or else (L.Count = R.Count
and then Less_Case_Insensitive
(Left =>
Right =>
end "<";
Line 86 ⟶ 85:
procedure Find_Counts (S : String) is
function Strip_Character (S : String; C :
S_Copy_Index : Natural := 0;
begin
S_Copy_Index := S_Copy_Index + 1;
else▼
& S (Comma_At + 1 .. S'Last), C);▼
end
return S_Copy_Str (S_Copy_Str'First .. S_Copy_Index);
end Strip_Character;
Line 101 ⟶ 103:
of Unbounded_String;
-- This list is quite comprehensive, but not complete
Categories_To_Ignore : Unbounded_String_Array := [
+"Programming",
+"Examples needing attention",
Line 150 ⟶ 152:
];
begin
for
declare
Category_At : constant Natural :=
Index (+To_Lower (L),
To_Lower (To_String (Category)));
To_String (Categories_To_Ignore (I))));▼
begin
if Category_At /= 0 then
Line 166 ⟶ 167:
end Ignore_Category;
Title_Str : constant String
End_A_Tag_Str : constant String
Space_Paren_Str : constant String := " (";
Line 192 ⟶ 193:
Count : constant Natural :=
Natural'Value
begin
if Closing_Bracket_At /= 0
Line 233 ⟶ 236:
Http_Source : constant AWS.Response.Data :=
AWS.Client.Get ("http://rosettacode.org/w/index.php?" &
"title=Special:Categories&limit=5000",
Status : Status_Code;
begin
Line 255 ⟶ 258:
Put_Line ("Process complete.");
end Rank_Languages_By_Popularity;
</syntaxhighlight>
{{out|Sample output}}
|