Count Proper Nouns - warwickfoster/qurantools GitHub Wiki

File: app/charts/chart_lemmata.php

Purpose

The provided code snippet is an HTML and PHP file that generates a chart displaying the occurrences of a specific lemma across different Surahs in an Islamic corpus.

Key Features

  • Data Visualization The chart is created using the FusionCharts JavaScript library, which provides a visual representation of the data.
  • Interactive Controls The user can interact with the chart to filter the data by provenance (Meccan, Medinan, or All Suras), count type (all occurrences or occurrences per 100 words), and sort order.
  • Data Source The data is retrieved from a database and passed to the PHP script through URL parameters.
  • Responsive Design The chart is responsive and adjusts its size based on the screen size.

How it Works

  1. PHP Code

    • Retrieves the lemma, provenance filter, count type, and sort order from the URL parameters.
    • Queries the database to retrieve the necessary data.
    • Sets the chart parameters based on the retrieved data.
  2. HTML Code

    • Creates the HTML structure for the chart container, navigation controls, and page header.
    • Includes the necessary JavaScript and CSS files for the chart and interactive controls.

Usage

The code can be used to display the lemma occurrence data for different Suras in an Islamic corpus. The user can use the interactive controls to filter the data and customize the chart presentation.

Additional Features

  • The code includes a footer with links to other pages, a print control, and a provenance footer.
  • The user preference for transliteration style is respected.

Conclusion

The code snippet provides a comprehensive solution for visualizing and interacting with lemma occurrence data in an Islamic corpus. It is a valuable tool for researchers and learners interested in analyzing the linguistic and textual features of the Quran.