Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,28 +0,0 @@
with Ada.Text_IO; use Ada.Text_IO;
procedure Simple_FASTA is
Current: Character;
begin
Get(Current);
if Current /= '>' then
raise Constraint_Error with "'>' expected";
end if;
while not End_Of_File loop -- read name and string
Put(Get_Line & ": "); -- read name and write directly to output
Read_String:
loop
exit Read_String when End_Of_File; -- end of input
Get(Current);
if Current = '>' then -- next name
New_Line;
exit Read_String;
else
Put(Current & Get_Line);
-- read part of string and write directly to output
end if;
end loop Read_String;
end loop;
end Simple_FASTA;

View file

@ -1,46 +0,0 @@
with Ada.Text_IO, Ada.Containers.Indefinite_Ordered_Maps; use Ada.Text_IO;
procedure FASTA is
package Maps is new Ada.Containers.Indefinite_Ordered_Maps
(Element_Type => String, Key_Type => String);
Map: Maps.Map; -- Map holds the full file (as pairs of name and value)
function Get_Value(Previous: String := "") return String is
Current: Character;
begin
if End_Of_File then
return Previous; -- file ends
else
Get(Current); -- read first character
if Current = '>' then -- ah, a new name begins
return Previous; -- the string read so far is the value
else -- the entire line is part of the value
return Get_Value(Previous & Current & Get_Line);
end if;
end if;
end Get_Value;
procedure Print_Pair(Position: Maps.Cursor) is
begin
Put_Line(Maps.Key(Position) & ": " & Maps.Element(Position));
-- Maps.Key(X) is the name and Maps.Element(X) is the value at X
end Print_Pair;
Skip_This: String := Get_Value;
-- consumes the entire file, until the first line starting with '>'.
-- the string Skip_This should be empty, but we don't verify this
begin
while not End_Of_File loop -- read the file into Map
declare
Name: String := Get_Line;
-- reads all characters in the line, except for the first ">"
Value: String := Get_Value;
begin
Map.Insert(Key => Name, New_Item => Value);
-- adds the pair (Name, Value) to Map
end;
end loop;
Map.Iterate(Process => Print_Pair'Access); -- print Map
end FASTA;